Binary Search Tree Last Updated : 06 Dec, 2025 Comments Improve Suggest changes 27 Likes Like Report A Binary Search Tree (BST) is a type of binary tree data structure in which each node contains a unique key and satisfies a specific ordering property:All nodes in the left subtree of a node contain values strictly less than the node’s value. All nodes in the right subtree of a node contain values strictly greater than the node’s value.This structure enables efficient operations for searching, insertion, and deletion of elements, especially when the tree remains balanced.BSTs are widely used in database indexing, symbol tables, range queries, and are foundational for advanced structures like AVL tree and Red-Black tree. In problem solving, BSTs are used in problems where we need to maintain sorted stream of data. Operations like search, insertion, and deletion work in O(Log n) time for a balanced binary search tree. In the worst-case (unbalanced), these degrade to O(n). With self-balancing BSTs like AVL and Red Black Trees, we can ensure the worst case as O(Log n).BasicsIntroductionApplications Insertion, Search and Delete Minimum and Maximum Floor and Ceil Inorder Successor and Inorder Predecessor Handling duplicates in BSTEasy ProblemsSecond largestSum of k smallest BST keys in given Range BST to Balanced BSTCheck for BSTBinary Tree to BST Check if array is Inorder of BSTSorted Array to Balanced BSTCheck Equal BSTs BST to Min HeapAdd all greater values in a BSTCheck if two BSTs have same elementsMedium ProblemsBST from PreorderSorted Linked List to Balanced BSTTransform a BST to greater sum treeBST to a Tree with sum of all smaller keysConstruct BST from Level Order Check for Level Order of BSTMax Sum with No Two Adjacent in BSTLCA in a BSTDistance between Two Nodesk-th Smallest in BST Largest BST in a Binary Tree | Set 2Remove all leaves from BST2 sum in BSTMax between two nodes of BSTLargest BST Subtree2 Sum in a Balanced BSTFix a BST with 2 swappedLeaf nodes from Preorder of a BST Check if an Array can represent BSTHard ProblemsAll possible BSTs for keys 1 to NIn-place Convert BST into a Min-Heap Merge two BSTs K’th Largest in BST without change Check for Subsequence Max Subarray Unique Element Pairs with sum from two BSTs3 Sum in a Balanced BST Replace with the least greater on rightLeaf nodes from Preorder Minimum Possible value of |ai + aj – k|Special two digit numbers in a BST Important LinksQuiz on BSTQuiz on Balanced BST Practice Problems’ on BST DSA Tutorial GfG 160: DSA 360° Create Quiz Binary Search Tree(Background) Visit Course Binary Search Tree(Background) Binary Search Tree(Introduction) Comment H harendrakumar123 Follow 27 Improve H harendrakumar123 Follow 27 Improve Article Tags : DSA Explore DSA FundamentalsLogic Building Problems 2 min read Analysis of Algorithms 1 min read Data StructuresArray Data Structure 3 min read String in Data Structure 2 min read Hashing in Data Structure 2 min read Linked List Data Structure 2 min read Stack Data Structure 2 min read Queue Data Structure 2 min read Tree Data Structure 2 min read Graph Data Structure 3 min read Trie Data Structure 15+ min read AlgorithmsSearching Algorithms 2 min read Sorting Algorithms 3 min read Introduction to Recursion 15 min read Greedy Algorithms 3 min read Graph Algorithms 3 min read Dynamic Programming or DP 3 min read Bitwise Algorithms 4 min read AdvancedSegment Tree 2 min read Binary Indexed Tree or Fenwick Tree 15 min read Square Root (Sqrt) Decomposition Algorithm 15+ min read Binary Lifting 15+ min read Geometry 2 min read Interview PreparationInterview Corner 3 min read GfG160 3 min read Practice ProblemGeeksforGeeks Practice - Leading Online Coding Platform 1 min read Problem of The Day - Develop the Habit of Coding 5 min read Like