Question: Problem 7. (53 POINTS) When we search in Google for A B C D this is equivalent to searching for A AND B AND C

 Problem 7. (53 POINTS) When we search in Google for "A

Problem 7. (53 POINTS) When we search in Google for "A B C D" this is equivalent to searching for "A AND B AND C AND D", i.e. searching for all documents that contain all four keywords A,B,C and D. We ask you to design an algorithm that does so efficiently. The lirst thing a search engine does is to generate a hit-list for each keyword. A hit-list is a sorted sequence of document-identifiers (doe-id's) that contain the keyword in question. Let the hit-lists be in the form of sorted arrays A[1..a],B[1.b],C[1.c],D[1.d] of doc-id's for the four keywords respectively. Let the lengths of the arrays A,B,C and D be respectively a,b,c,d, where a=n3,b=nlgn,c=n2 and d=n. for some parameter n. Give an efficient algorithm that generates the hit-list of doe-ids in which all four keywords A,B,C,D appear; this output hit-list should also be sorted by doc-id. How big is the output hit-list ? Express your answer in asymptotic notation in terms of n with a bound that is as asymptotically tight ns possible. Express the running time of your proposed efficient algorithm in terms of n using asymptotic notation (as tight as possible)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!