1,186 views
2 votes
2 votes

When a user submits a query, a search engine does the following. For every webpage that has been visited by the search engine, it computes a score indicating how relevant that page is to the query. Finally, it reports the pages with the top k scores on the screen, for a number $k$ specified by the user. A good data structure for accumulating the scores and ranking them is:

  1. a queue
  2. a heap
  3. a stack
  4. a binary search tree

2 Answers

0 votes
0 votes
Ans D) a binary search tree

say a BST we have increasing or decreasing order

So, rather than heap it can can check top k score easily

Say search engine search for top 5 DBMS scores

So, first go to branch of BST which gives DBMS score and then find top five scores

Related questions

1 votes
1 votes
4 answers
1
go_editor asked May 23, 2016
1,039 views
A simple graph is one in which there are no self loops and each pair of distinct vertices is connected by at most one edge. Show that any finite simple graph has at least...