Hacker News new | ask | show | jobs
by webreac 4529 days ago
That's exactly what I did. My fixed code is smaller than the original code and fast enough to go to level 1. It is in perl (I am not fluent in ruby).
2 comments

I'd love to know that you have reference to show that with a large amount of data set, hashing is faster than linked list. I don't have the reference at hand, but I know that hashing has a higher cost from speed and memory point of view.

I don't see the original code is a huge issue per se which requires 19 levels? of improvement? I'm curious about how you guys move on though. Will appreciate if you can keep post your solution and progress.

I guess at the end of the entire program, people may learn how to send the query to multiple indexing servers in a concurrent (I prefer this than "distributed") system and then gather together of all the results. At the end of it, it shows how advanced algorithms Google search engine is used to index terabyte of data.

Is that the ultimate solution for a web of data? Take a look of the discussion: http://bit.ly/1f7xIve

I changed one line to make it work faster.

From the "best" score I was worse than it by 150 or something. Not that I care really.

Looks like one simple change to hashmap may not be the best answer. May I draw the conclusion from your case like that? The best score now went up to almost 3000. I couldn't imagine how many possible ways out there and one of them could be that excellent. Just curious.
Sorted list + binary search was 2000pts and ran much faster than the hashmap solution.
Thank you so much for your info. This is something I'm looking for from the beginning of the discussion.

http://www.algolist.net/Algorithms/Binary_search

This is my original answer! I should not sort the input list though since it's not necessary.

But is string.indexOf() will be even faster?