面试场景
高频考察问题建模、边界条件与口头表达的清晰度。
常见误区
只背模板不解释为什么,容易在追问里失分。
练习策略
每轮练 3-5 题,固定复盘复杂度和可替代解法。
推荐练习顺序
题库
栈 题库
先展示一段最适合快速浏览的题目列表,继续滚动时再慢慢续载,避免专题页被长列表一下子拉穿。
慢加载专题题库
适合这类题很多的专题,先扫结构,再逐步深入。
当前展示 24 / 140 道题目
每次续载 24 题有效的括号
Determine if a string of parentheses, brackets, and braces is correctly nested using a stack for proper order validation…
最长有效括号
Compute the length of the longest well-formed parentheses substring using state transition dynamic programming and stack…
接雨水
Calculate the total trapped rain water using the elevation map array, leveraging dynamic programming and two-pointer pat…
简化路径
Simplify a Unix-style path by transforming it into its canonical form using stack-based state management.
柱状图中最大的矩形
Find the maximal rectangular area in a histogram using stack-based state management for precise bar tracking and width c…
最大矩形
Compute the largest rectangle of 1's in a binary matrix using dynamic programming and stack-based state transitions effi…
二叉树的中序遍历
Binary Tree Inorder Traversal asks you to visit left subtree, node, then right subtree without losing position while mov…
二叉树展开为链表
Flatten a binary tree into a right-skewed linked list by manipulating pointers following a pre-order traversal, handling…
重排链表
Reorder List requires careful pointer manipulation in a singly linked list to interleave nodes from the ends without alt…
二叉树的前序遍历
Perform a binary tree preorder traversal by visiting root nodes first, then left and right subtrees, tracking state iter…
二叉树的后序遍历
Solve Binary Tree Postorder Traversal using state tracking and binary-tree traversal techniques, focusing on Stack, Tree…
逆波兰表达式求值
Compute the result of an arithmetic expression in Reverse Polish Notation using a stack to manage operands efficiently.
最小栈
Design a stack with O(1) operations to push, pop, retrieve the top element, and get the minimum element in constant time…
二叉搜索树迭代器
Implement an iterator for in-order traversal of a binary search tree (BST), maintaining traversal state with stack-based…
基本计算器
Implement a basic calculator to evaluate mathematical expressions, ensuring correct evaluation with stack-based manageme…
用队列实现栈
This problem tests your ability to simulate a LIFO stack using two queues while preserving all standard stack operations…
基本计算器 II
Basic Calculator II evaluates a mathematical expression with operators and integers, handling basic arithmetic with prec…
用栈实现队列
Implement a queue using two stacks, focusing on stack-based state management to achieve FIFO behavior in a queue.
回文链表
Solve Palindrome Linked List by finding the midpoint, reversing the second half, and comparing mirrored nodes in linear …
去除重复字母
Remove duplicate letters from a string to produce the lexicographically smallest result using stack-based state manageme…
拼接最大数
Create Maximum Number involves merging digits from two arrays while preserving order, maximizing the resulting number.
验证二叉树的前序序列化
Determine if a given string correctly represents a binary tree preorder traversal using state tracking and slot counting…
扁平化嵌套列表迭代器
Implement an iterator to flatten a nested list of integers, accounting for potential nesting levels.
迷你语法分析器
Deserialize a nested list string using stack-based state management, handling integers and nested lists with depth-first…
swap_vert在题库框内继续向下滚动,也会自动续载