Re:Bubblesort, rocksort, and cocktail-shaker sort
by coldpie on Wednesday December 16, 2020 @08:53AM
(#25442452)
I don't think I have ever implemented a sort. What modern tooling doesn't provide a sort? Even C has qsort.
[ Parent
| on HN ]
Re:Bubblesort, rocksort, and cocktail-shaker sort
by iainmerrick on Monday December 21, 2020 @11:35AM
(#25496463)
Why even bother teaching it, then?
(Semi-serious question, as you're quite right that hardly anyone ever needs to write a sort routine by hand these days.)
Re:Bubblesort, rocksort, and cocktail-shaker sort
by ogogmad on Tuesday December 22, 2020 @11:24AM
(#25507889)
Maybe it's the things you learn along the way, such as:
- Recursion and induction (mergesort, quicksort)
- Lower bounds on running time (O(n log n))
- Data structures (heaps in the context of heapsort, binary search trees in the context of treesort, tries in the context of radix sort, etc.)
- Difference between worst case and average case (quicksort)
- The role of the hidden coefficient in O notation (insertion sort is fast for small n even though its running time is O(n^2))
Etc.