LeetCodechevron_rightCategorieschevron_rightbinary search tree
search

binary search tree

29 problems
Easy: 9Medium: 18Hard: 2

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

#TitleDifficulty
95

Unique Binary Search Trees II

Generate all structurally unique BSTs with values 1 to n using backtracking and recursive tree construction techniques.

Medium
96

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.

Medium
98

Validate Binary Search Tree

Validate Binary Search Tree problem checks if a binary tree satisfies BST properties using tree traversal and state trac…

Medium
99

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…

Medium
108

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.

Easy
109

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…

Medium
173

Binary Search Tree Iterator

Implement an iterator for in-order traversal of a binary search tree (BST), maintaining traversal state with stack-based…

Medium
230

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.

Medium
235

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…

Medium
449

Serialize and Deserialize BST

Design an algorithm to serialize and deserialize a binary search tree with efficient traversal and state tracking.

Medium
450

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…

Medium
501

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.

Easy
530

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…

Easy
538

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.

Medium
653

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…

Easy
669

Trim a Binary Search Tree

Trim a Binary Search Tree by maintaining its structure while removing nodes outside a given range.

Medium
700

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 …

Easy
701

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…

Medium
703

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…

Easy
783

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…

Easy
897

Increasing Order Search Tree

Rearrange a binary search tree so all nodes follow increasing order with only right children using in-order traversal.

Easy
938

Range Sum of BST

Given a BST and a range, calculate the sum of all node values within that range.

Easy
1008

Construct Binary Search Tree from Preorder Traversal

Construct a binary search tree directly from a preorder traversal array using stack-based state tracking efficiently.

Medium
1038

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…

Medium
1305

All Elements in Two Binary Search Trees

Merge elements from two binary search trees and return them sorted in ascending order.

Medium
1373

Maximum Sum BST in Binary Tree

Find the maximum sum of values from any Binary Search Tree (BST) subtree in a binary tree.

Hard
1382

Balance a Binary Search Tree

This problem requires balancing a binary search tree using in-order traversal and state tracking techniques.

Medium
1569

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.

Hard
2476

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…

Medium

Related Patterns

Binary Search Tree LeetCode Problems: 29 Solutions