Which is the best Method used for Sorting? [duplicate]

梦想的初衷 提交于 2019-12-14 03:29:21

问题


Possible Duplicate:
What sort algorithm provides the best worst-case performance?

Which is the best method that can be used to sort an Integer array?Is Quick Sort efficient? Some of the common methods used for sorting are mentioned in [spam link removed]


回答1:


They are different sorting methods are available with different features.

Bubble Sort  [It's simple but not good for large data][1]

Selection Sort  [Selection sort is noted for its simplicity, and also has performance advantages over more complicated algorithms in certain situations, particularly where auxiliary memory is limited.][2]

Insertion Sort [It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.][3]

Quick Sort [Quicksort is often faster in practice than other O(nlogn) algorithms][4]

Merge Sort [Merge sort is an O(n log n) comparison-based sorting algorithm][5]

Heap Sort [it has the advantage of a more favorable worst-case O(n log n) runtime. Heapsort is an in-place algorithm, but is not a stable sort.][6]


来源:https://stackoverflow.com/questions/6907178/which-is-the-best-method-used-for-sorting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!