I have been assigned a task to develop a program to store the sorted data in ascending order. Initially, I have used linked list data structure to store the data but search operation was time consuming then I decided to use BST (Binary Search Tree) but retrieval efficiency is not improved. In such situation, how can I improve the efficiency of search operation for BST?
Answers
Answered by
1
how can I improve the efficiency of search operation for BST?
- BST is a special type of binary tree in which left child of a node has value less than the parent and right child has value greater than parent.
- Retrieval in BST can be hectic and time consuming.But,there are various methods and data structures you can use for easy retrieval of data.
- Try using AVL trees ,circular linked list can help if not the singly linked list or doubly linked list.
- AVL tree is binary search tree with additional property that difference between height of left sub-tree and right sub-tree of any node can’t be more than 1.
- Circular Linked List is a variation of Linked list in which the first element points to the last element and the last element points to the first element.
Similar questions