🚀 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 #409LC-1490TreesNC Algo100
Medium

Clone N-ary Tree (克隆 N 叉树)

You are given a reference to an N-ary tree. Return a deep copy of the tree. Constraints: the number of nodes is in [0, 10^4], 0 &l...

View Solution→
NeetCode #410LC-1506TreesNC Algo100
Medium

Find Root of N-Ary Tree (找到 N 叉树的根节点)

You are given all the nodes of an N-ary tree as an array. Each node has a unique value and a children list. Return the root of the...

View Solution→
NeetCode #411LC-1522TreesNC Algo100
Medium

Diameter of N-Ary Tree (N 叉树的直径)

Given the root of an N-ary tree, return its diameter: the length of the longest path between any two nodes, measured in edges. Con...

View Solution→
NeetCode #412LC-364Trees
Medium

Nested List Weight Sum II (嵌套列表加权和 II)

This is an interactive problem. You are given a nested list of integers where each element is an integer or a list. Return the sum...

View Solution→
NeetCode #413LC-272TreesNC Algo100
Hard

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

Given the root of a binary search tree, a target and an integer k, return the k values in the BST closest to the target, in any or...

View Solution→
NeetCode #414LC-428TreesNC Algo100
Hard

Serialize and Deserialize N-ary Tree (序列化和反序列化 N 叉树)

Design an algorithm to serialise and deserialise an N-ary tree. Constraints: the number of nodes is in [0, 10^4], 0 <= Node.val...

View Solution→
NeetCode #415LC-431TreesNC Algo100
Hard

Encode N-ary Tree to Binary Tree (将 N 叉树编码为二叉树)

Design an algorithm to convert an N-ary tree into a binary tree and back. The binary tree must follow the left-child, right-siblin...

View Solution→
NeetCode #416LC-2196Trees
Medium

Create Binary Tree From Descriptions (根据描述创建二叉树)

You are given a 2D array descriptions where descriptions[i] = [parent, child, isLeft] describes a binary tree edge. Return the roo...

View Solution→
NeetCode #417LC-116Trees
Medium

Populating Next Right Pointers in Each Node (填充每个节点的下一个右侧节点指针)

You are given a perfect binary tree where all leaves are at the same depth and every parent has two children. Each node has an ext...

View Solution→
NeetCode #418LC-606Trees
Medium

Construct String from Binary Tree (根据二叉树创建字符串)

Given the root of a binary tree, construct a string of parentheses and integers from a pre-order traversal: an empty tree is "", a...

View Solution→
NeetCode #419LC-236Trees
Medium

Lowest Common Ancestor of a Binary Tree (二叉树的最近公共祖先)

Given a binary tree and two nodes p and q, return their lowest common ancestor: the deepest node that has both as descendants (a n...

View Solution→
NeetCode #420LC-1650Trees
Medium

Lowest Common Ancestor of a Binary Tree III (二叉树的最近公共祖先 III)

Given two nodes p and q in a binary tree where each node has a parent pointer, return their lowest common ancestor. Constraints: t...

View Solution→
NeetCode #421LC-235TreesBlind 75NC 150NC 250
Medium

Lowest Common Ancestor of a Binary Search Tree (二叉搜索树的最近公共祖先)

Given a binary search tree and two nodes p and q, return their lowest common ancestor (LCA). Constraints: the number of nodes is i...

View Solution→
NeetCode #422LC-701TreesNC 250
Medium

Insert into a Binary Search Tree (二叉搜索树中的插入操作)

You are given the root of a binary search tree and a value val to insert. Insert the value and return the root. The input tree is ...

View Solution→
NeetCode #423LC-450TreesNC 250
Medium

Delete Node in a BST (删除二叉搜索树中的节点)

Given the root of a binary search tree and a key, delete the node with that key and return the root. The tree must remain a valid ...

View Solution→
NeetCode #424LC-102TreesBlind 75NC 150NC 250
Medium

Binary Tree Level Order Traversal (二叉树的层序遍历)

Given the root of a binary tree, return its level-order traversal: a list of lists, where each inner list holds the values at one ...

View Solution→
NeetCode #425LC-199TreesNC 150NC 250
Medium

Binary Tree Right Side View (二叉树的右视图)

Given the root of a binary tree, imagine standing on the right side of it and return the values of the nodes visible from top to b...

View Solution→
NeetCode #426LC-2415Trees
Medium

Reverse Odd Levels of Binary Tree (反转二叉树的奇数层)

Given the root of a perfect binary tree, reverse the node values at each odd level (the root is level 0). Return the root. Constra...

View Solution→
NeetCode #427LC-2471Trees
Medium

Minimum Number of Operations to Sort a Binary Tree by Level (逐层排序二叉树所需的最少操作数目)

You are given the root of a binary tree. In one operation you may swap the values of two nodes on the same level. Return the minim...

View Solution→
NeetCode #428LC-2583Trees
Medium

Kth Largest Sum in a Binary Tree (二叉树中的第 K 大层和)

You are given the root of a binary tree and a positive integer k. Return the k-th largest level sum (the sum of node values at eac...

View Solution→
NeetCode #429LC-2641Trees
Medium

Cousins in Binary Tree II (二叉树的堂兄弟节点 II)

Given the root of a binary tree, replace each node's value with the sum of all values on the same level that are not its cousins' ...

View Solution→
NeetCode #430LC-783Trees
Easy

Minimum Distance Between BST Nodes (二叉搜索树节点最小距离)

Given the root of a binary search tree, return the minimum difference between the values of any two distinct nodes. Constraints: t...

View Solution→
NeetCode #431LC-101Trees
Easy

Symmetric Tree (对称二叉树)

Given the root of a binary tree, check whether it is mirror-symmetric around its centre. Constraints: the number of nodes is in [1...

View Solution→
NeetCode #432LC-1367Trees
Medium

Linked List in Binary Tree (二叉树中的链表)

Given a binary tree root and a linked list head, return true if the list's values form a downward path in the tree. Constraints: t...

View Solution→