I have a large text file (~ 10mb) that has more or less every dictionary in a particular language, and each word is a new line.
I want to do a very quick search to see if a word exists in a file - What is the fastest way to do this without scrolling through each line?
It is sorted and I can do all the preprocessing I want.
I was considering the possibility of doing some kind of binary search, but I did not know how to do this, since all my lines are not a fixed number of bytes (and therefore, I do not know where to stream the stream). And it is amazing that I could not find a tool to make a fixed width for me.
Any suggestions? Thank!
source
share