Sorting 10 million integers with 1 MB space Solution explanation - Programming Pearls
问题 I was reading "Programming Pearls" and I am really confused in one of the solution explanations. The question was: "A file containing at most n positive integers, each less than n, where n = 10^7. Each positive integer could appear at most ten times. How would you sort the file?" Given solution in the book: " If each integer appears at most ten times, then we can count its occurence in a four-bit half byte. Using the solution to Problem 5 (below) we can sort the complete file in a single pass