🚀 NeetCode 973 Algorithm HandbookBlind 75 · NC 150 · NC 25019 Core Categories

NeetCode Comprehensive Algorithm Bank & Offline Handbook

Synchronized bilingual toggle with dual NeetCode & LeetCode problem numbering and direct links. Features step-by-step logic, benchmark Python3 code, complexity analysis, interview pitfalls, and standalone offline exports.

Mastery Progress
0.0%(0/973)
● Mastered: 0
◐ Reviewing: 0
○ Unstarted: 973
🔍
🎯 Featured Lists
📂 Categories (19 Core Topics)
Diff:
Mastery:
Showing 24 problems
NeetCode #385LC-590Trees
Easy

N-ary Tree Postorder Traversal (N 叉树的后序遍历)

Given the root of an N-ary tree, return its post-order traversal (children left to right, then the node) as a list of values. Cons...

View Solution→
NeetCode #386LC-226TreesBlind 75NC 150NC 250
Easy

Invert Binary Tree (翻转二叉树)

Given the root of a binary tree, invert it (swap every node's left and right children) and return its root. Constraints: the numbe...

View Solution→
NeetCode #387LC-104TreesBlind 75NC 150NC 250
Easy

Maximum Depth of Binary Tree (二叉树的最大深度)

Given the root of a binary tree, return its maximum depth: the number of nodes along the longest path from the root down to the fa...

View Solution→
NeetCode #388LC-543TreesNC 150NC 250
Easy

Diameter of Binary Tree (二叉树的直径)

Given the root of a binary tree, return the length of its diameter: the number of edges on the longest path between any two nodes....

View Solution→
NeetCode #389LC-110TreesNC 150NC 250
Easy

Balanced Binary Tree (平衡二叉树)

Given a binary tree, determine whether it is height-balanced: for every node, the heights of its two subtrees differ by at most 1....

View Solution→
NeetCode #390LC-100TreesBlind 75NC 150NC 250
Easy

Same Tree (相同的树)

Given the roots of two binary trees p and q, return true if they are structurally identical and every corresponding node has the s...

View Solution→
NeetCode #391LC-572TreesBlind 75NC 150NC 250
Easy

Subtree of Another Tree (另一棵树的子树)

Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node v...

View Solution→
NeetCode #392LC-108Trees
Easy

Convert Sorted Array to Binary Search Tree (将有序数组转换为二叉搜索树)

Given an integer array nums sorted in ascending order, convert it to a height-balanced binary search tree. Constraints: 1 <= nu...

View Solution→
NeetCode #393LC-617Trees
Easy

Merge Two Binary Trees (合并二叉树)

You are given two binary trees root1 and root2. Merge them: where both nodes exist, the merged value is their sum; otherwise the e...

View Solution→
NeetCode #394LC-112Trees
Easy

Path Sum (路径总和)

Given the root of a binary tree and an integer targetSum, return true if there is a root-to-leaf path whose values sum to the targ...

View Solution→
NeetCode #395LC-938Trees
Easy

Range Sum of BST (二叉搜索树的范围和)

Given the root of a binary search tree and two integers low and high, return the sum of all values in the inclusive range [low, hi...

View Solution→
NeetCode #396LC-872Trees
Easy

Leaf-Similar Trees (叶子相似的树)

Consider all the leaves of a binary tree, from left to right, forming a sequence. Two trees are leaf-similar if their leaf sequenc...

View Solution→
NeetCode #397LC-2331Trees
Easy

Evaluate Boolean Binary Tree (计算布尔二叉树的值)

You are given the root of a full binary tree where leaves have value 0 (false) or 1 (true), and internal nodes have value 2 (OR) o...

View Solution→
NeetCode #398LC-270TreesNC Algo100
Easy

Closest Binary Search Tree Value (最接近的二叉搜索树值)

Given the root of a binary search tree and a floating-point target, return the value in the tree closest to the target. If several...

View Solution→
NeetCode #399LC-314TreesNC Algo100
Medium

Binary Tree Vertical Order Traversal (二叉树的垂序遍历)

Given the root of a binary tree, return its vertical order traversal: a list of columns from leftmost to rightmost, where each col...

View Solution→
NeetCode #400LC-298TreesNC Algo100
Medium

Binary Tree Longest Consecutive Sequence (二叉树最长连续序列)

Given the root of a binary tree, find the length of the longest consecutive path: a path where each node's value is exactly one gr...

View Solution→
NeetCode #401LC-549TreesNC Algo100
Medium

Binary Tree Longest Consecutive Sequence II (二叉树最长连续序列 II)

Given the root of a binary tree, return the length of the longest consecutive path. Unlike the basic version, this path may be eit...

View Solution→
NeetCode #402LC-250TreesNC Algo100
Medium

Count Univalue Subtrees (统计同值子树)

Given the root of a binary tree, return the number of uni-value subtrees: subtrees in which every node has the same value. Constra...

View Solution→
NeetCode #403LC-1120TreesNC Algo100
Medium

Maximum Average Subtree (子树的最大平均值)

Given the root of a binary tree, return the maximum average value of any subtree. A subtree is a node plus all its descendants, an...

View Solution→
NeetCode #404LC-545TreesNC Algo100
Medium

Boundary of Binary Tree (二叉树的边界)

Given the root of a binary tree, return its boundary traversal: the root, then the left boundary (excluding leaves) top-down, then...

View Solution→
NeetCode #405LC-366TreesNC Algo100
Medium

Find Leaves of Binary Tree (寻找二叉树的叶子节点)

Given the root of a binary tree, collect all its nodes level by level from the leaves upward: first all leaves are removed, then t...

View Solution→
NeetCode #406LC-255TreesNC Algo100
Medium

Verify Preorder Sequence in Binary Search Tree (验证前序遍历序列二叉搜索树)

Given an array of unique integers preorder, return true if it is the pre-order traversal of some binary search tree. Constraints: ...

View Solution→
NeetCode #407LC-1214TreesNC Algo100
Medium

Two Sum BSTs (查找两棵二叉搜索树中的两数之和)

Given the roots of two binary search trees and an integer target, return true if there is a node in the first tree and a node in t...

View Solution→
NeetCode #408LC-333TreesNC Algo100
Medium

Largest BST Subtree (最大 BST 子树)

Given the root of a binary tree, return the size of the largest subtree that is also a binary search tree. Constraints: the number...

View Solution→