Suppose that you are using a binary search tree and you know how often each of t
ID: 3602623 • Letter: S
Question
Suppose that you are using a binary search tree and you know how often each of the keys will be searched for. If you are able to add the keys in any order that you want, what approach would you use? 0 A. Insert the keys in increasing order O B. The order does not matter ° C. insert the keys in decreasing order of frequency of access-insert the most frequently searched for items first 0 D. Insert the keys in decreasing order 0 E. None of these ° F. insert the keys in random order O G. insert the keys in increasing order of frequency of access -insert the least frequently searched for items firstExplanation / Answer
The answer us C. Generally in Binary search Trees the keys which are inserted before will be near the root of the tree and will be found faster. So we add them in to the tree in decreasing order of their frequency.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.