Citrix System Inc Interview Question
Country: India
Interview Type: In-Person
If it is about unsigned integers then a possible approach is to use counting sort, which would use comparing of bits. Thus, if you create a 32x2 (64x2) table count[bit_position][0/1] and fill it with number of numbers in the file with 0/1 on the bit_position and then you can use this array to perform a sort.
This is a typical external sorting. You can find the answer in many classical data structure textbooks or wiki "en.wikipedia.org/wiki/External_sorting"
- Jason November 26, 2013