题库chevron_right分类chevron_right递归
refresh

递归

40 道题目
简单: 10中等: 17困难: 13

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

面试场景

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

常见误区

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

练习策略

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

推荐练习顺序

#题目难度
2

两数相加

Add Two Numbers requires careful linked-list pointer manipulation to sum digits while handling carries efficiently in in…

中等
10

正则表达式匹配

The Regular Expression Matching problem involves checking if a string matches a pattern using '.' and '*'.

困难
21

合并两个有序链表

Merge two sorted linked lists by splicing nodes into one sorted list using linked-list pointer manipulation and recursio…

简单
24

两两交换链表中的节点

Learn how to swap every adjacent linked-list pair by rewiring nodes safely without changing values or breaking the remai…

中等
25

K 个一组翻转链表

Reverse Nodes in k-Group challenges you to reverse segments of a linked list in groups of size k.

困难
44

通配符匹配

Implement full wildcard pattern matching using '?' and '*' by applying state transition dynamic programming with careful…

困难
50

Pow(x, n)

Calculate x to the power n efficiently using recursion and exponentiation, handling negative powers and large inputs saf…

中等
60

排列序列

Find the kth permutation sequence of a set of numbers using math and recursion to efficiently compute the result.

困难
143

重排链表

Reorder List requires careful pointer manipulation in a singly linked list to interleave nodes from the ends without alt…

中等
203

移除链表元素

Remove all nodes from a linked list that have a specific value, adjusting pointers to preserve the rest of the list.

简单
206

反转链表

Reverse a singly linked list in place, converting the head to tail, with an iterative or recursive approach.

简单
224

基本计算器

Implement a basic calculator to evaluate mathematical expressions, ensuring correct evaluation with stack-based manageme…

困难
231

2 的幂

Determine if a given integer is a power of two using efficient math and bit manipulation techniques with optional recurs…

简单
233

数字 1 的个数

Compute the total number of digit one appearing in all numbers from 0 up to n using state transition dynamic programming…

困难
234

回文链表

Solve Palindrome Linked List by finding the midpoint, reversing the second half, and comparing mirrored nodes in linear …

简单
241

为运算表达式设计优先级

Solve Different Ways to Add Parentheses by splitting on each operator and memoizing every subexpression result list.

中等
273

整数转换英文表示

Convert a given integer to its English words representation using mathematical logic and string manipulation.

困难
326

3 的幂

Determine if a given integer is a power of three using math and recursion techniques.

简单
342

4的幂

Determine if a given integer is a power of four using math insights and bit manipulation tricks efficiently in code.

简单
390

消除游戏

Elimination Game uses a systematic removal of numbers with alternating left-right passes, solvable with math and recursi…

中等
394

字符串解码

Decode a nested encoded string using stack-based state management, handling repeated patterns efficiently with recursion…

中等
486

预测赢家

Predict the Winner involves two players taking turns to maximize their score by picking from either end of an array, opt…

中等
509

斐波那契数

Calculate the nth Fibonacci number using state transition dynamic programming and recursive techniques efficiently in in…

简单
736

Lisp 语法解析

Parse Lisp expressions using stack-based state management to evaluate variables and operations.

困难
761

特殊的二进制字符串

Solve the Special Binary String problem using string manipulation and recursion, optimizing lexicographical order.

困难
770

基本计算器 IV

Simplify mathematical expressions using stack-based state management, handling variables, operators, and polynomial term…

困难
779

第K个语法符号

Determine the K-th symbol in a recursively generated grammar table using math and bit manipulation patterns efficiently.

中等
894

所有可能的真二叉树

Generate all possible full binary trees with n nodes, focusing on dynamic programming and binary tree traversal.

中等
1106

解析布尔表达式

Solve the "Parsing A Boolean Expression" problem by evaluating boolean expressions using stack-based state management, r…

困难
1545

找出第 N 个二进制字符串中的第 K 位

Determine the k-th bit in the n-th binary string using a recursive construction that inverts and reverses previous strin…

中等
1808

好因子的最大数目

Solve Maximize Number of Nice Divisors by splitting primeFactors into mostly 3s and using fast modular exponentiation.

困难
1823

找出游戏的获胜者

Find the winner of a circular game by simulating the elimination process with a queue-driven approach.

中等
1922

统计好数字的数目

Count Good Numbers uses a mathematical pattern with recursion to efficiently count digit strings of length n under stric…

中等
1969

数组元素的最小非零乘积

The problem asks to minimize the product of an array after performing bit-swapping operations on its binary representati…

中等
2487

从链表中移除节点

This problem requires removing nodes from a linked list when a larger node exists to their right, testing pointer manipu…

中等
2550

猴子碰撞的方法数

Calculate the total number of monkey collisions on a convex polygon using math and recursion efficiently for large n.

中等
3304

找出第 K 个字符 I

Find the K-th character in a progressively built string using math and bit manipulation efficiently.

简单
3307

找出第 K 个字符 II

Find the K-th character in a string game using bit manipulation and recursion, optimizing performance for large k values…

困难
3483

不同三位偶数的数目

Given an array of digits, find how many distinct 3-digit even numbers can be formed without repetition of digits and no …

简单
3566

等积子集的划分方案

Determine if you can partition an array into two subsets with equal product using recursion and bit manipulation.

中等

关联高频模式

LeetCode 递归题型题解:40题训练路线