怎么选择# Biology - 生物学
b*e
1 楼
You have millions of documents numbered 1,2,3,4,5 ......
You also have a mapping from a word to the list of documents that contains i
t
Find all the 'pair of words' that occur together in one and only document
Bitmap
It can be done in O(m+n)/O(Max(m,n)) time complexity and O(m*n bits).
We can calculate a BitMap for the given work by setting all the bits corresp
onding to each file(number). This BitMap will take O(m) space. The BitMap of
both words can be compared in o(1) time (any weird insane c
You also have a mapping from a word to the list of documents that contains i
t
Find all the 'pair of words' that occur together in one and only document
Bitmap
It can be done in O(m+n)/O(Max(m,n)) time complexity and O(m*n bits).
We can calculate a BitMap for the given work by setting all the bits corresp
onding to each file(number). This BitMap will take O(m) space. The BitMap of
both words can be compared in o(1) time (any weird insane c