4 ms·
Not exactly what you are asking for but ... To sort ~500 student tests by name, my favorite algorithm is * Each person grabs a bunch of test. Split the test i
by gus_massa 5y ago
Not exactly what you are asking for but ...
To sort ~500 student tests by name, my favorite algorithm is
* Each person grabs a bunch of test. Split the test in 4 piles, using the first letter: A-F, G-L, M-Q, R-Z The same 4 piles for everyone. (I don't remember the exact borders. It may depend on your language. Perhaps 5 piles is better.)
* Each persons grabs a pile. Split each pile in subpiles by the first letter again. If some letter is too popular, split it using the second letter.
* Sort each small subpile, that has only 10-20 tests, probably using insert sort.
* Make a giant pile.
This can be classified as a combination of radix sort and insert sort. It's easy to parallelize to 5-10 persons.
If you later realize there are ~50 more test, just sort them using your favorite method and then use merge them, like in mergesort (or timsort?).