题库chevron_right分类chevron_right
layers

140 道题目
简单: 23中等: 75困难: 42

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

面试场景

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

常见误区

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

练习策略

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

推荐练习顺序

题库

栈 题库

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

慢加载专题题库

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

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 140 道题目

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

有效的括号

Determine if a string of parentheses, brackets, and braces is correctly nested using a stack for proper order validation…

简单
32

最长有效括号

Compute the length of the longest well-formed parentheses substring using state transition dynamic programming and stack…

困难
42

接雨水

Calculate the total trapped rain water using the elevation map array, leveraging dynamic programming and two-pointer pat…

困难
71

简化路径

Simplify a Unix-style path by transforming it into its canonical form using stack-based state management.

中等
84

柱状图中最大的矩形

Find the maximal rectangular area in a histogram using stack-based state management for precise bar tracking and width c…

困难
85

最大矩形

Compute the largest rectangle of 1's in a binary matrix using dynamic programming and stack-based state transitions effi…

困难
94

二叉树的中序遍历

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

简单
114

二叉树展开为链表

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

中等
143

重排链表

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

中等
144

二叉树的前序遍历

Perform a binary tree preorder traversal by visiting root nodes first, then left and right subtrees, tracking state iter…

简单
145

二叉树的后序遍历

Solve Binary Tree Postorder Traversal using state tracking and binary-tree traversal techniques, focusing on Stack, Tree…

简单
150

逆波兰表达式求值

Compute the result of an arithmetic expression in Reverse Polish Notation using a stack to manage operands efficiently.

中等
155

最小栈

Design a stack with O(1) operations to push, pop, retrieve the top element, and get the minimum element in constant time…

中等
173

二叉搜索树迭代器

Implement an iterator for in-order traversal of a binary search tree (BST), maintaining traversal state with stack-based…

中等
224

基本计算器

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

困难
225

用队列实现栈

This problem tests your ability to simulate a LIFO stack using two queues while preserving all standard stack operations…

简单
227

基本计算器 II

Basic Calculator II evaluates a mathematical expression with operators and integers, handling basic arithmetic with prec…

中等
232

用栈实现队列

Implement a queue using two stacks, focusing on stack-based state management to achieve FIFO behavior in a queue.

简单
234

回文链表

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

简单
316

去除重复字母

Remove duplicate letters from a string to produce the lexicographically smallest result using stack-based state manageme…

中等
321

拼接最大数

Create Maximum Number involves merging digits from two arrays while preserving order, maximizing the resulting number.

困难
331

验证二叉树的前序序列化

Determine if a given string correctly represents a binary tree preorder traversal using state tracking and slot counting…

中等
341

扁平化嵌套列表迭代器

Implement an iterator to flatten a nested list of integers, accounting for potential nesting levels.

中等
385

迷你语法分析器

Deserialize a nested list string using stack-based state management, handling integers and nested lists with depth-first…

中等

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

关联高频模式

LeetCode 栈题型题解:140题训练路线