Topic: Binary search in the big text file
There is a file in which lines are arranged. Lines of different length (about 50 characters). It is necessary to find all the line long with the specified prefix. If to load in storage, banal binary search. If in storage not to load, as a whole all is clear how to do, but a heap of trifles. We halve a file byte by byte, we move to one side, we search for the beginning of a line, we move to other side, we search for a line end. Still with UTF-8 it is desirable to work, so it is possible and to get to the character middle initially. Adequate buffering, kilobyte on 4 is necessary. In general it is a lot of nuances. Who can saw in the nature ready good implementation of such task?