Sorting 1 million 8-digit numbers in 1MB of RAM

Posted by Favourite Chigozie Onwuemene on Stack Overflow See other posts from Stack Overflow or by Favourite Chigozie Onwuemene
Published on 2012-10-05T14:17:12Z Indexed on 2012/10/21 23:01 UTC
Read the original article Hit count: 196

Filed under:
|
|
|

I have a computer with 1M of RAM and no other local storage. I must use it to accept 1 million 8-digit decimal numbers over a TCP connection, sort them, and then send the sorted list out over another TCP connection. The list of numbers may contain duplicates, which I must not discard. The code will be placed in ROM, so I need not subtract the size of my code from the 1M. I already have code to drive the ethernet port and handle TCP/IP connections, and it requires 2k for its state data, including a 1k buffer via which the code will read and write data. Is there a solution to this problem?

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about sorting