How to sort millions of rows of data in a file with less/meagre memory

后端 未结 9 517
不思量自难忘°
不思量自难忘° 2021-02-01 06:44

(From here)

I attended an interview last week and this question was asked:

How do you sort a billion rows of data in a file with only 640KB of memory in

9条回答
  •  梦毁少年i
    2021-02-01 07:28

    You can find the discussion on a similar problem in Jon Bentley Programming Pearls Column. 1. Here Bentley deals with a problem of sorting millions of area codes which are guaranteed to be unique by using a bitset data-structure.

提交回复
热议问题