3 ms·
It's fairly popular in extremely resource constrained embedded systems (micro-controllers). Because like bubble and insertion sort, it doesn't need a stack, the
by woadwarrior01 3y ago
It's fairly popular in extremely resource constrained embedded systems (micro-controllers). Because like bubble and insertion sort, it doesn't need a stack, the average case time complexity is often better than bubble sort and insertion sort. Also, it can be tuned to a certain extent using different gap sequences.
- nwallin 3y agoHeapsort is best and worst case O(n log n), does not require a stack, and the code is simple; more complicated than shellsort but no so much that you'd notice. I feel like heapsort is always a better choice than shellsort, no? If I were to make a list of 50 algorithms that every programmer should know, I can't imagine why I would put bubblesort and shellsort on the list, but include neither heapsort nor quicksort.
- AlchemistCamp 3y agoI agree. Heapsort is on the optimal frontier.