3 ms·
I recall some kind of sort that requires a construction of link list for storing index numbers of the original array. Only that the final link list (of index n
by egberts1 5y ago
I recall some kind of sort that requires a construction of link list for storing index numbers of the original array.
Only that the final link list (of index numbers) were in sorted order of which you then summarily write in the final array.
Which would have consumed some (n*(row-size)+n*(link-ptr-size+value-size) memory outside of its original array.
probably did O(n^1.5 for read operation which is WAY better than O(n^2) for bubble-sort.
Best in-its class algorithm for swap at O(2), worst case?
Delving into swap breakdown, its write operation might be O(3n+1) for writing a value then updating a link list pointer for each entry and for its link value into that final array; +1 for that NULL pointer at the end.
was arguably the lowest O (way back then) but at extremely high cost of memory.
Never did learn which sort class did that variant falls into.
EDITED: insertion class, memory-hog-style.
- egberts1 5y agoNow I remember, it was a college try to improve the read operation of insertion-class sort algorithm. One guy knocked down the time order considerably by doing tiny pre-bubblesort in blocks before entering into the link-insertion thereby making less passes over its million link-list chains: but only because he leveraged to fitting within its CPU L2/L3 cache. Professor said that the order got worse but not by huge logarithmic scale despite time speed-ups for completion. Dang, the O order just got complicated for multi-level caches.