You are designing an algorithm that ranks website pages by relevance according to the number of times they are viewed by users. Which data structure would be the most useful and efficient for you to use?
A. A hash table because data would be efficiently searched and retrieved
B. A stack because the website pages would need to be popped and pushed systematically from the ranking list
C. A graph because Elizabeth needs data relating to how webpages are connected to each other and how many times they were viewed
D. A sorted array because all the data relating to web pages needs to be sorted in a ranking order
E. None of the above
Answers
Answered by
5
The data structure which would be most efficient and useful to use is Stack.
Short notes on stack:
⇒ It is the best way to work with contiguous memory.
⇒ It allows easier processing of data.
⇒ It provides management of databases like indexing with the help of hash tables.
So, the answer is Option(B) - A stack because the website pages would need to be popped and pushed systematically from the ranking list.
Hope it helps!
Similar questions