🚀 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 #433LC-1443Trees
Medium

Minimum Time to Collect All Apples in a Tree (收集树上所有苹果的最少时间)

Given an undirected tree with n nodes rooted at 0, edges, and a boolean array hasApple, return the minimum time in seconds to coll...

View Solution→
NeetCode #434LC-103Trees
Medium

Binary Tree Zigzag Level Order Traversal (二叉树的锯齿形层序遍历)

Given the root of a binary tree, return its zigzag level-order traversal: levels alternate between left-to-right and right-to-left...

View Solution→
NeetCode #435LC-427TreesNC 250
Medium

Construct Quad Tree (建立四叉树)

Given an n x n binary matrix grid with n a power of two, construct a quad tree where each node has isLeaf, val (only meaningful fo...

View Solution→
NeetCode #436LC-652Trees
Medium

Find Duplicate Subtrees (寻找重复的子树)

Given the root of a binary tree, return all duplicate subtrees: subtrees that occur more than once anywhere in the tree, with the ...

View Solution→
NeetCode #437LC-958Trees
Medium

Check Completeness of a Binary Tree (二叉树的完全性检验)

Given the root of a binary tree, determine whether it is a complete binary tree: every level except possibly the last is full, and...

View Solution→
NeetCode #438LC-106Trees
Medium

Construct Binary Tree from Inorder and Postorder Traversal (从中序与后序遍历序列构造二叉树)

Given two integer arrays inorder and postorder representing the in-order and post-order traversals of a binary tree, construct and...

View Solution→
NeetCode #439LC-662Trees
Medium

Maximum Width of Binary Tree (二叉树最大宽度)

Given the root of a binary tree, return the maximum width of the tree: the maximum number of nodes between the leftmost and rightm...

View Solution→
NeetCode #440LC-1376Trees
Medium

Time Needed to Inform All Employees (通知所有员工所需的时间)

A company has n employees with a unique head, given by headID and the manager array. Each manager takes informTime[i] minutes to i...

View Solution→
NeetCode #441LC-1448TreesNC 150NC 250
Medium

Count Good Nodes in Binary Tree (统计二叉树中好节点的数目)

Given a binary tree, a node X is good if, on the path from the root to X, there is no node with a value greater than X.val. Return...

View Solution→
NeetCode #442LC-98TreesBlind 75NC 150NC 250
Medium

Validate Binary Search Tree (验证二叉搜索树)

Given the root of a binary tree, determine whether it is a valid binary search tree: every node's value must be strictly greater t...

View Solution→
NeetCode #443LC-230TreesBlind 75NC 150NC 250
Medium

Kth Smallest Element in a BST (二叉搜索树中第 K 小的元素)

Given the root of a binary search tree and an integer k, return the k-th smallest value (1-indexed). Constraints: the number of no...

View Solution→
NeetCode #444LC-99Trees
Medium

Recover Binary Search Tree (恢复二叉搜索树)

You are given the root of a binary search tree in which exactly two nodes were swapped by mistake. Recover the tree without changi...

View Solution→
NeetCode #445LC-105TreesBlind 75NC 150NC 250
Medium

Construct Binary Tree from Preorder and Inorder Traversal (从前序与中序遍历序列构造二叉树)

Given two integer arrays preorder and inorder representing the pre-order and in-order traversal of a binary tree, construct and re...

View Solution→
NeetCode #446LC-889Trees
Medium

Construct Binary Tree from Preorder and Postorder Traversal (根据前序和后序遍历构造二叉树)

Given two integer arrays preorder and postorder representing the pre-order and post-order traversal of a binary tree, construct an...

View Solution→
NeetCode #447LC-96Trees
Medium

Unique Binary Search Trees (不同的二叉搜索树)

Given an integer n, return the number of structurally unique binary search trees that store exactly n distinct values. Constraints...

View Solution→
NeetCode #448LC-95Trees
Medium

Unique Binary Search Trees II (不同的二叉搜索树 II)

Given an integer n, return all structurally unique binary search trees that store the values 1..n. Return the roots in any order. ...

View Solution→
NeetCode #449LC-1530Trees
Medium

Number of Good Leaf Nodes Pairs (好叶子节点对的数量)

Given the root of a binary tree and an integer distance, return the number of good leaf node pairs: two leaves whose shortest path...

View Solution→
NeetCode #450LC-129Trees
Medium

Sum Root to Leaf Numbers (求根节点到叶节点数字之和)

You are given the root of a binary tree containing digits from 0 to 9. Each root-to-leaf path represents a number formed by concat...

View Solution→
NeetCode #451LC-337TreesNC 250
Medium

House Robber III (打家劫舍 III)

A thief plans to rob houses arranged in a binary tree. Adjacent houses (parent and child) cannot both be robbed. Return the maximu...

View Solution→
NeetCode #452LC-951Trees
Medium

Flip Equivalent Binary Trees (翻转等价二叉树)

For a binary tree T, a flip swaps a node's left and right children. Two trees are flip equivalent if one can be made identical to ...

View Solution→
NeetCode #453LC-1993Trees
Medium

Operations on Tree (树上的操作)

Design a locking tree with n nodes numbered 0..n-1 and a parent array (parent[i] is the parent of i, -1 for the root). Implement l...

View Solution→
NeetCode #454LC-894Trees
Medium

All Possible Full Binary Trees (所有可能的真二叉树)

Given an integer n, return a list of all possible full binary trees with n nodes. A full binary tree has nodes with either 0 or 2 ...

View Solution→
NeetCode #455LC-513Trees
Medium

Find Bottom Left Tree Value (找树左下角的值)

Given the root of a binary tree, return the value of the bottom-left node: the leftmost node in the deepest level. Constraints: th...

View Solution→
NeetCode #456LC-669Trees
Medium

Trim a Binary Search Tree (修剪二叉搜索树)

Given the root of a binary search tree and bounds low and high, trim the tree so all its values lie in [low, high], preserving the...

View Solution→