3 ms·
And exactly what data structure do you suppose is appropriate for Bob?
by brianpan 14y ago
And exactly what data structure do you suppose is appropriate for Bob?
- tgflynn 14y agoProbably a hash map from words to definitions along with a list of positions within each definition record. I may post an implementation later if nobody beats me to it but I don't have time right now.
- jgrahamc 14y agoWhat's the point? This is an example to show people what a one way function looks like. I even say at the bottom of the blog post that you wouldn't do this on a computer. This specific one way function is hard for a human to reverse. Writing a computer program to automate Bob's work is completely missing the point.
- eyeface 14y agoAn algorithm that takes polynomial time would not be feasible given the size of a dictionary, assuming you're running it on poor old Bob (who is not a computer).