面试场景
高频考察问题建模、边界条件与口头表达的清晰度。
常见误区
只背模板不解释为什么,容易在追问里失分。
练习策略
每轮练 3-5 题,固定复盘复杂度和可替代解法。
推荐练习顺序
题库
图 题库
先展示一段最适合快速浏览的题目列表,继续滚动时再慢慢续载,避免专题页被长列表一下子拉穿。
慢加载专题题库
适合这类题很多的专题,先扫结构,再逐步深入。
当前展示 24 / 141 道题目
每次续载 24 题克隆图
Clone Graph involves cloning a graph using DFS, focusing on graph traversal and neighbor management using hash tables.
课程表
Determine if all courses can be completed by analyzing prerequisite dependencies using indegree tracking and topological…
课程表 II
Solve the 'Course Schedule II' problem using graph indegree and topological ordering, utilizing DFS or BFS to find the c…
最小高度树
Identify all roots of a tree that produce minimum height using graph indegree analysis and topological trimming.
矩阵中的最长递增路径
Find the length of the longest increasing path in a matrix with given movement constraints using graph techniques.
重新安排行程
Reconstruct Itinerary requires building a valid travel route using all tickets once, starting from JFK with lexical orde…
除法求值
Compute the results of division queries from given equations using graph traversal and depth-first search efficiently.
省份数量
Solve Number of Provinces by scanning the adjacency matrix and launching DFS once per unvisited city component.
冗余连接
Identify and remove the redundant edge that causes a cycle in a graph starting as a tree.
冗余连接 II
Find and remove the redundant connection in a directed graph that was originally a rooted tree.
网络延迟时间
Find the minimum time for a signal to travel to all nodes in a directed graph or determine if it's impossible.
破解保险箱
The Cracking the Safe problem involves finding the shortest password sequence to unlock a safe using graph traversal and…
情侣牵手
This problem requires arranging couples sitting apart in a row with the minimum number of swaps using graph traversal an…
判断二分图
Determine whether an undirected graph can be split into two independent sets using DFS, BFS, or Union Find patterns.
K 站中转内最便宜的航班
Find the cheapest flight from a source to a destination with at most K stops using graph traversal techniques efficientl…
所有可能的路径
Find all paths in a directed acyclic graph (DAG) from source to target using depth-first search and backtracking.
找到最终的安全状态
Solve the problem of finding eventual safe states in a directed graph using depth-first search and topological sorting.
树中距离之和
The problem asks to compute the sum of distances between each node and all others in a tree structure using depth-first …
钥匙和房间
Determine if all rooms can be visited given keys distributed across a set of interconnected locked rooms using graph tra…
访问所有节点的最短路径
Solve the Shortest Path Visiting All Nodes problem by exploring dynamic programming, bit manipulation, and breadth-first…
喧闹和富有
Determine the quietest person richer than each individual using graph indegree analysis and topological ordering techniq…
细分图中的可到达节点
The Reachable Nodes In Subdivided Graph problem requires efficiently finding the reachable nodes using graph traversal a…
可能的二分法
Determine if a group of n people with mutual dislikes can be split into two non-conflicting groups using graph traversal…
猫和老鼠
Determine the outcome of a two-player Cat and Mouse game on a graph using topological ordering and memoized dynamic prog…
swap_vert在题库框内继续向下滚动,也会自动续载