8.3k views
0 votes
Suppose as a computer programmer, you have been assigned a task to develop a program to store the sorted data in ascending order. Initially you have used linked list data structure to store the data but search operation was time consuming then you decided to use BST (Binary Search Tree) but retrieval efficiency is not improved. In such situation, How can you improve the efficiency of search operation for BST? Justify your answer with solid reason.

User Rross
by
5.1k points

1 Answer

4 votes

Answer:

In case the data is arranged in the ascending order, you can always change the Binary search tree into a Height BST, and which is also known as the self-balancing BT. And through this, it's quite on hand to better the operations like searching on the new BST. And these SBBTs are quite commonly made use of for constructing as well as maintaining the ordered list. This is the case in the case of the priority queue, and this is what is required here.

Step-by-step explanation:

Please check the answer.

User Martin Hunt
by
5.1k points