题库chevron_right分类chevron_right二叉树
park

二叉树

130 道题目
简单: 35中等: 85困难: 10

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

面试场景

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

常见误区

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

练习策略

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

推荐练习顺序

题库

二叉树 题库

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

慢加载专题题库

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

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 130 道题目

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

二叉树的中序遍历

Binary Tree Inorder Traversal asks you to visit left subtree, node, then right subtree without losing position while mov…

简单
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…

中等
100

相同的树

Check whether two binary trees are identical by comparing structure and node values using DFS or BFS traversal strategie…

简单
101

对称二叉树

Determine if a binary tree is symmetric by comparing left and right subtrees using DFS or BFS traversal techniques effic…

简单
102

二叉树的层序遍历

Perform a level order traversal on a binary tree using BFS to return node values level by level.

中等
103

二叉树的锯齿形层序遍历

Traverse a binary tree in zigzag level order, alternating directions at each depth using BFS and state tracking techniqu…

中等
104

二叉树的最大深度

Find the maximum depth of a binary tree using traversal techniques to track the longest path from root to leaf.

简单
105

从前序与中序遍历序列构造二叉树

Construct a binary tree using preorder and inorder traversal arrays, leveraging array scanning and hash table lookups.

中等
106

从中序与后序遍历序列构造二叉树

Reconstruct a binary tree from given inorder and postorder arrays using array scanning and hash lookup to optimize recur…

中等
107

二叉树的层序遍历 II

Return a bottom-up level order traversal of a binary tree, processing nodes left to right while tracking each level accu…

中等
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…

中等
110

平衡二叉树

Determine if a binary tree is height-balanced using tree traversal and state tracking techniques.

简单
111

二叉树的最小深度

Find the minimum depth of a binary tree, which is the shortest path from the root node to the nearest leaf node.

简单
112

路径总和

Determine if a binary tree has a root-to-leaf path where the sum of node values equals a given target sum, using DFS or …

简单
113

路径总和 II

Find all root-to-leaf paths in a binary tree where the sum of node values equals a given target using DFS backtracking.

中等
114

二叉树展开为链表

Flatten a binary tree into a right-skewed linked list by manipulating pointers following a pre-order traversal, handling…

中等
116

填充每个节点的下一个右侧节点指针

Connect each node across every level by reusing established next links to traverse a perfect binary tree without extra q…

中等
117

填充每个节点的下一个右侧节点指针 II

Populate each next pointer in a binary tree to its immediate right node, handling nulls and uneven levels efficiently us…

中等
124

二叉树中的最大路径和

Calculate the maximum sum of any path in a binary tree by exploring all node sequences using DFS and dynamic programming…

困难
129

求根节点到叶节点数字之和

Calculate the sum of all root-to-leaf numbers in a binary tree where each path represents a number.

中等

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

关联高频模式

LeetCode 二叉树题型题解:130题训练路线