Disadvantages of Binary Search Tree
- The performance of BST depends upon its balance.
- Skewed BST is the worst-case scenario where the search complexity becomes O(n), just like any other tree.
- Although operations like insertion and deletion are easy in BST, maintaining the balance of the tree is hard.
- If the tree is made by using a sorted list, then the creation can lead to a highly unbalanced BST which degrades its performance. One solution is to balance the tree after every insertion.
- Binary search tree become less efficient for very large datasets
Binary Search Tree in C++
A Binary Search Tree (BST) is a type of binary tree in which the data is organized and stored in a sorted order. Unlike, a binary tree that doesn’t follow a specific order for node placement, in a binary search tree all the elements on the left side of a node are smaller than the node itself, and elements on the right side of a node are greater.
In this article, we will learn more about the binary search tree, operations performed on BST, and implementation of BST, as well as the advantages, disadvantages, and applications of binary search tree in C++.
Contact Us