Is there a better way to find set intersection for Search engine code?
问题 I have been coding up a small search engine and need to find out if there is a faster way to find set intersections. Currently, I am using a Sorted linked list as explained in most search engine algorithms. i.e for every word I have a list of documents sorted in a list and then find the intersection among the lists. The performance profiling of the case is here. Any other ideas for a faster set intersection? 回答1: An efficient way to do it is by "zig-zag": Assume your terms is a list T :