flâneur — a map of the web's best reading

Quicksort - Wikipedia

en.wikipedia.org · 11,630 words · saved by 1 readers

Quicksort is an efficient, general-purpose sorting algorithm. Quicksort was developed by British computer scientist Tony Hoare in 1959[1] and published in 1961.[2] It is still a commonly used algorithm for sorting. Overall, it is slightly faster than merge sort and heapsort for randomized data, particularly on larger distributions.[3] Quicksort is a divide-and-conquer algorithm. It works by selecting a 'pivot' element from the array and partitioning the other elements into two sub-arrays, according to whether they are less than or greater than the pivot. For this reason, it is sometimes called partition-exchange sort.[4] The sub-arrays are then sorted recursively. This can be done in-place, requiring small additional amounts of memory to perform the sorting. Quicksort is a comparison sort, meaning that it can sort items of any type for which a "less-than" relation (formally, a total order) is defined. It is a comparison-based sort since elements a and b are only swapped in case their r

Quicksort - Wikipedia Jump to content From Wikipedia, the free encyclopedia Divide and conquer sorting algorithm O(n^2)</math> (rarely) <!-- If it wasn't rare, the average time would be closer to it. -->"},"average-time":{"wt":"<math>O(n\\log n)</math>"},"best-time":{"wt":"<math>O(n\\log n)</math> (simple partition)<br />or <math>O(n)</math> (three-way partition and equal keys)"},"space":{"wt":"<math>O(n)</math> auxiliary (naive)<br /><math>O(\\log n)</math> auxiliary (Hoare 1962)<!-- see his paper and discussion of the 'nest' use -->"},"optimal":{"wt":"No <!-- optimal is defined as worst case

Explore this link on the map →

related reading