Which is the fastest sorting algorithm? asked 10 Nov '16, 00:29

Inbuilt function of sort available in "algorithm" header file of C/C++.. sort() are much faster than any other implemented sort!! answered 10 Nov '16, 00:44

Merge Sort is the fastest stable sorting algorithm with worstcase complexity of O(nlogn), but it requires extra space. Although, if memory constraints are very tight you can use Quick Sort, whose worsttime compelxity is O($n^{2}$) but average case complexity is O(nlogn).
answered 10 Nov '16, 00:44

Answer is hidden as author is suspended. Click here to view.
answered 10 Nov '16, 17:22

For competitive programming purposes, the standard library sort() should do just fine. In C++ it is an implementation of introsort. Mergesort is often not a great candidate because of all the extra memory used. On a side note, there is a sorting algorithm, block sort, that:
answered 25 Nov '16, 18:05

This is a good link for time complexity of various algorithms and data structures. answered 24 Nov '16, 23:58

1)Merge Sort is unarguably the fastest sorting algorithm with a worstcase complexity= O(n logn) . This means that whatever be the arrangement of the elements in the array, it won't take more than n*logn steps to sort the array. A standard computer generally takes 1 second to perform 10^8 such steps/operations. An important point to note here is that the base of the logarithm is 2 and not 10 or e as generally taken in schools. The only disadvantage of Merge Sort is that it requires extra space , i.e. an extra array to merge the sorted elements into. This is important to know because sometimes additional space has a great cost attached with it. 2)Quicksort is usually the sorting algorithm that is used everywhere. A few examples of this would be the inbuilt java, C++ sorting functions, MS Excel ,etc. Quicksort has an average worstcase complexity of O(n logn) but a worstcase complexity of O(n^2). However, this only occurs when the array is already sorted and can be overcome by randomizing the position of the pivot everytime. This is a very convenient technique since it does not have the additional cost of an entire new array. answered 25 Nov '16, 00:27

Well there's no de facto 'fastest sorting algorithm (Else there'd be just one sorting algorithm and everybody would've used that). It all depends on how the input data is.
answered 26 Nov '16, 19:32

fastest sorting algorithm will be the merge sort.since the time complexity is less even in the worst case(nlogn).Even if the array is properly arranged or not,it wouldn't take more than nlogn steps to sort the array. answered 26 Nov '16, 20:15
