What should the proper name for the QuickSort algorithm be?

  • Thread starter Thread starter swampwiz
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary
SUMMARY

The QuickSort algorithm, developed by C.A.R. Hoare in 1960, is recognized as one of the fastest sorting algorithms for random datasets, although it can degrade to O(n²) in the worst-case scenario. The algorithm's essence lies in its method of partitioning elements around a pivot, ensuring that elements on one side are less than those on the other. While some propose renaming it to "SwapSort" due to its extensive swapping operations, the established name remains QuickSort. The discussion highlights the distinction between in-place sorting algorithms and those that require additional memory for sorted copies.

PREREQUISITES
  • Understanding of sorting algorithms, specifically QuickSort
  • Familiarity with algorithmic complexity, including O(n) and O(n²) notations
  • Knowledge of in-place vs. out-of-place sorting techniques
  • Basic concepts of pivot selection and partitioning in sorting
NEXT STEPS
  • Research the implementation details of QuickSort in programming languages like Python and Java
  • Learn about the variations of QuickSort, including randomized QuickSort
  • Explore the differences between in-place and out-of-place sorting algorithms
  • Study the historical context and evolution of sorting algorithms, focusing on C.A.R. Hoare's contributions
USEFUL FOR

Computer scientists, software engineers, and students studying algorithms who seek to deepen their understanding of sorting techniques and their historical significance.

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.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
13K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
29
Views
6K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K