Algorithm · Microsoft · Easy
Requirements An input file holds an unsorted sequence of distinct integers, with every value in [0, 32000]. The only available I/O operations are: getNum() — returns the next integer, or a sentinel when the input is exhausted. putNum(int) — writes one integer to the output file. Produce the values in ascending order by using a bit vector of length 32001. The important constraint is the memory bound: a conventional in-memory sort uses more memory than necessary for this…
Checking your access…