binary search tree
binary search tree is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.
Interview Signal
Frequently tests problem modeling, edge handling, and verbal clarity.
Common Pitfall
Template-only answers break under follow-up questioning.
Practice Strategy
Practice in 3-5 problem rounds and always review complexity alternatives.
Recommended Progression
Foundation
Unique Binary Search Trees II
Generate all structurally unique BSTs with values 1 to n using backtracking and recursive tree construction techniques.
Unique Binary Search Trees
Given n nodes, calculate the number of unique binary search trees (BSTs) that can be formed with values from 1 to n.
Validate Binary Search Tree
Validate Binary Search Tree problem checks if a binary tree satisfies BST properties using tree traversal and state trac…
Recover Binary Search Tree
Recover a BST where two nodes are swapped by mistake using in-order traversal and careful state tracking to restore corr…
Convert Sorted Array to Binary Search Tree
Pick the middle element as root at each step so the sorted array becomes a height-balanced BST with valid ordering.
Convert Sorted List to Binary Search Tree
Convert a sorted singly linked list into a height-balanced BST using pointer manipulation and divide-and-conquer recursi…
Binary Search Tree Iterator
Implement an iterator for in-order traversal of a binary search tree (BST), maintaining traversal state with stack-based…
Kth Smallest Element in a BST
Find the kth smallest element in a BST by leveraging in-order traversal to efficiently track node order and count.
Lowest Common Ancestor of a Binary Search Tree
Find the lowest common ancestor (LCA) of two nodes in a binary search tree, using binary-tree traversal and state tracki…
Serialize and Deserialize BST
Design an algorithm to serialize and deserialize a binary search tree with efficient traversal and state tracking.
Delete Node in a BST
Delete Node in a BST hinges on removing one target while preserving in-order ordering through carefully chosen subtree r…
Find Mode in Binary Search Tree
Find Mode in Binary Search Tree asks to identify the most frequent element(s) in a BST using binary-tree traversal.
Minimum Absolute Difference in BST
Find the minimum absolute difference between values of any two nodes in a BST using tree traversal and careful state tra…
Convert BST to Greater Tree
Convert a BST into a Greater Tree by updating each node’s value with the sum of all greater values in the tree.
Two Sum IV - Input is a BST
Determine if a binary search tree contains two nodes whose values sum to a target using efficient traversal and state tr…
Trim a Binary Search Tree
Trim a Binary Search Tree by maintaining its structure while removing nodes outside a given range.
Search in a Binary Search Tree
Locate a target value in a binary search tree and return the subtree rooted at that node using efficient tree traversal …
Insert into a Binary Search Tree
Insert a value into a Binary Search Tree while maintaining the BST properties, focusing on tree traversal and state trac…
Kth Largest Element in a Stream
Find the kth largest element in a dynamic stream using binary-tree traversal and efficient state tracking with a min-hea…
Minimum Distance Between BST Nodes
Find the minimum difference between values of two different nodes in a Binary Search Tree using tree traversal and state…
Increasing Order Search Tree
Rearrange a binary search tree so all nodes follow increasing order with only right children using in-order traversal.
Range Sum of BST
Given a BST and a range, calculate the sum of all node values within that range.
Construct Binary Search Tree from Preorder Traversal
Construct a binary search tree directly from a preorder traversal array using stack-based state tracking efficiently.
Binary Search Tree to Greater Sum Tree
Convert a Binary Search Tree to a Greater Sum Tree by accumulating all larger node values using reverse in-order travers…
All Elements in Two Binary Search Trees
Merge elements from two binary search trees and return them sorted in ascending order.
Maximum Sum BST in Binary Tree
Find the maximum sum of values from any Binary Search Tree (BST) subtree in a binary tree.
Balance a Binary Search Tree
This problem requires balancing a binary search tree using in-order traversal and state tracking techniques.
Number of Ways to Reorder Array to Get Same BST
Determine the number of ways to reorder an array to get the same binary search tree (BST) from its insertion order.
Closest Nodes Queries in a Binary Search Tree
Solve the problem of finding closest nodes in a Binary Search Tree for multiple queries, efficiently handling each query…