Interview puzzle: Sorting a million number input with limited memory

后端 未结 3 920
野性不改
野性不改 2020-12-29 01:02

I tried answering this using external sort, but interviewer replied that the complexity was to high n.n(log(n)) i.e. n square *logn. Is there a better alternative.

T

3条回答
  •  一整个雨季
    2020-12-29 01:17

    Perhaps the interviewer expected you to ask: Are those numbers the unique seven digit telephone numbers mentioned by J. Bentley (Cracking the Oyster)?

提交回复
热议问题