3 ms·
I'd break the first pass down further, putting items into the (yearly) bins without sorting within each bin, freeing up bins, then subdividing them into smaller
by pronoiac 16y ago
I'd break the first pass down further, putting items into the (yearly) bins without sorting within each bin, freeing up bins, then subdividing them into smaller piles (say, by month), then sorting those.
This insight is courtesy of a sorting algorithm that's optimal for systems with very limited memory but multiple tape systems, if I remember correctly. Also IIRC insertion sort can beat doing the binary sort in situations of 7-20 or so? Much over a dozen, I can't use my fingers of one hand as bookmarks to do, say, three comparisons to find the right place, & I'd rather break it down into more piles.
- allenp 16y agoAlso if you just put them into bins by year, you could have others do the sorting per bin - so more of a distributed model.