What should the proper name for the QuickSort algorithm be?

  • Thread starter Thread starter swampwiz
  • Start date Start date
  • Tags Tags
    Algorithm
AI Thread Summary
QuickSort is recognized as one of the fastest sorting algorithms for random data, although it can degrade to O(n²) in the worst-case scenario. Its core mechanism involves identifying and swapping elements based on their comparison to a pivot value, ensuring that subsets are correctly divided. This characteristic leads to a suggestion to rename QuickSort to "SwapSort," reflecting its frequent use of swaps across various indices. However, the consensus remains to retain the name QuickSort. The discussion also highlights that while many sorting algorithms utilize swaps, some may not be in-place and can involve shifting elements instead. QuickSort was developed by C.A.R. Hoare in 1960, and historically, it was sometimes referred to as Hoare's QuickSort.
swampwiz
Messages
567
Reaction score
83
OK, I understand the deal - it was the (and seems to still be) the fastest algorithm for sorting a random set (although it can break down to O(n2) for the worst case non-random.) But it seems that it should have a name that describes its essence, like MergeSort or InsertionSort.

The essence of QuickSort is to find a pair of elements (from each side) that should be on the other side due to their comparison with the pivot value, and then swap them, thus guaranteeing that when the set is divided, the elements of one subset are always less than the elements of the other set (i.e., the conquering.) It seems to me that although most (all?) sort algorithms do swaps, rather than swapping between adjacent elements, or between one constant index element and that of another index, QuickSort does swaps all over the place. Thus, if I had to name QuickSort, I think I would name it SwapSort.

What do you think?
 
Technology news on Phys.org
No, please call it quicksort.

As for your observations that most sorts seem to use swaps, swaps are a feature of a number in-place algorithms. One might have a sorting algorithm that is not in-place. In this case, a sorted copy of the data might be made in a second data structure. A disadvantage of this is that it requires the extra memory for the second data structure.

Also, a sorting algorithm might perform an operation like shifting a bunch of elements by 1 position in the sequence, and this might be not be exactly the same as swapping things.
 
Last edited:
C A R Hoare first developed the QuickSort in 1960. Way back, some people used to use his name to refer to the QuickSort algorithm, Hoare's QuickSort.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top