题库chevron_right分类chevron_right二叉搜索树
search

二叉搜索树

29 道题目
简单: 9中等: 18困难: 2

二叉搜索树 是技术面试里最常出现的能力维度之一。建议先掌握基础题型的边界处理,再逐步过渡到模式识别和复杂度 trade-off。

面试场景

高频考察问题建模、边界条件与口头表达的清晰度。

常见误区

只背模板不解释为什么,容易在追问里失分。

练习策略

每轮练 3-5 题,固定复盘复杂度和可替代解法。

推荐练习顺序

题库

二叉搜索树 题库

先展示一段最适合快速浏览的题目列表,继续滚动时再慢慢续载,避免专题页被长列表一下子拉穿。

慢加载专题题库

适合这类题很多的专题,先扫结构,再逐步深入。

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 29 道题目

每次续载 24 题
#题目难度
95

不同的二叉搜索树 II

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

中等
96

不同的二叉搜索树

Given n nodes, calculate the number of unique binary search trees (BSTs) that can be formed with values from 1 to n.

中等
98

验证二叉搜索树

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

中等
99

恢复二叉搜索树

Recover a BST where two nodes are swapped by mistake using in-order traversal and careful state tracking to restore corr…

中等
108

将有序数组转换为二叉搜索树

Pick the middle element as root at each step so the sorted array becomes a height-balanced BST with valid ordering.

简单
109

有序链表转换二叉搜索树

Convert a sorted singly linked list into a height-balanced BST using pointer manipulation and divide-and-conquer recursi…

中等
173

二叉搜索树迭代器

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

中等
230

二叉搜索树中第 K 小的元素

Find the kth smallest element in a BST by leveraging in-order traversal to efficiently track node order and count.

中等
235

二叉搜索树的最近公共祖先

Find the lowest common ancestor (LCA) of two nodes in a binary search tree, using binary-tree traversal and state tracki…

中等
449

序列化和反序列化二叉搜索树

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

中等
450

删除二叉搜索树中的节点

Delete Node in a BST hinges on removing one target while preserving in-order ordering through carefully chosen subtree r…

中等
501

二叉搜索树中的众数

Find Mode in Binary Search Tree asks to identify the most frequent element(s) in a BST using binary-tree traversal.

简单
530

二叉搜索树的最小绝对差

Find the minimum absolute difference between values of any two nodes in a BST using tree traversal and careful state tra…

简单
538

把二叉搜索树转换为累加树

Convert a BST into a Greater Tree by updating each node’s value with the sum of all greater values in the tree.

中等
653

两数之和 IV - 输入二叉搜索树

Determine if a binary search tree contains two nodes whose values sum to a target using efficient traversal and state tr…

简单
669

修剪二叉搜索树

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

中等
700

二叉搜索树中的搜索

Locate a target value in a binary search tree and return the subtree rooted at that node using efficient tree traversal …

简单
701

二叉搜索树中的插入操作

Insert a value into a Binary Search Tree while maintaining the BST properties, focusing on tree traversal and state trac…

中等
703

数据流中的第 K 大元素

Find the kth largest element in a dynamic stream using binary-tree traversal and efficient state tracking with a min-hea…

简单
783

二叉搜索树节点最小距离

Find the minimum difference between values of two different nodes in a Binary Search Tree using tree traversal and state…

简单
897

递增顺序搜索树

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

简单
938

二叉搜索树的范围和

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

简单
1008

前序遍历构造二叉搜索树

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

中等
1038

从二叉搜索树到更大和树

Convert a Binary Search Tree to a Greater Sum Tree by accumulating all larger node values using reverse in-order travers…

中等

swap_vert在题库框内继续向下滚动,也会自动续载

关联高频模式

LeetCode 二叉搜索树题型题解:29题训练路线