I just can't seem to understand how this would work.
Question:
Given a sequential file that contains at most four billion 32 bit integers in random order, find a 32-bit integer that isn't in the file (and there must be at least one missing)
Answer:
it is helpful to view this binary search in terms of the 32 bits that represent each integer. In the first pass of the algorithm we read the (at most) four billion input integers and write those with a leading zero bit to one sequential file and those with a leading one bit to another file.
One of those files contains at most two billion integer, so we next use that file as the current input and repeat the probe process, but this time on the second bit.
So by splitting the file over and over again (binary search) how would this actually lead me to the missing 32 bit integer?