##
TimSort
May 19, 2017

TimSort is a sorting algorithm based on Insertion Sort and Merge Sort. A stable sorting algorithm works in O(n Log n) time Used in Java’s… Read More »

May 19, 2017

TimSort is a sorting algorithm based on Insertion Sort and Merge Sort. A stable sorting algorithm works in O(n Log n) time Used in Java’s… Read More »

March 26, 2017

Given a permuted array of length N of first N natural numbers, we need to tell the minimum number of swaps required in the sorted… Read More »

March 8, 2017

Given an array of integer values which need to be sorted by only one operation – subarray rotation where subarray size should be 3. For… Read More »

January 18, 2017

Given an integer array of which both first half and second half are sorted. Task is to merge two sorted halves of array into single… Read More »

July 25, 2016

Given a number ‘n’ and a n numbers, sort the numbers using Concurrent Merge Sort. (Hint: Try to use shmget, shmat system calls). Part1: The… Read More »

July 19, 2016

Some of the merge operation classes are provided in C++ STL under the header file “algorithm”, which facilitates several merge operations in a easy manner.… Read More »

July 9, 2016

A surpasser of an element of an array is a greater element to its right, therefore x[j] is a surpasser of x[i] if i <… Read More »

June 26, 2016

We have discussed sorting weapons used by different languages in previous article. In this article, C++’s Sorting Weapon, Introsort is discussed. What is Introsort? Simply… Read More »

Ever wondered how sort() function we use in C++/Java or sorted() in Python work internally? Here is a list of all the inbuilt sorting algorithms… Read More »

June 10, 2016

Given K sorted linked lists of size N each, merge them and print the sorted output. Example: Input: k = 3, n = 4 list1… Read More »

June 2, 2016

Given a set of elements, find which permutation of these elements would result in worst case of Merge Sort? Asymptotically, merge sort always takes ?(n… Read More »

May 25, 2016

Given two sorted singly linked lists having n and m elements each, merge them using constant space. First n smallest elements in both the lists… Read More »

May 12, 2016

Given a linked list which is sorted based on absolute values. Sort the list based on actual values. Examples: Input : 1 -> -10 output:… Read More »

April 22, 2016

External sorting is a term for a class of sorting algorithms that can handle massive amounts of data. External sorting is required when the data… Read More »

January 16, 2016

We are given two sorted array. We need to merge these two arrays such that the initial numbers (after complete sorting) are in the first… Read More »