题库chevron_right分类chevron_right
hub

141 道题目
简单: 3中等: 66困难: 72

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

面试场景

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

常见误区

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

练习策略

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

推荐练习顺序

题库

图 题库

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

慢加载专题题库

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

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 141 道题目

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

克隆图

Clone Graph involves cloning a graph using DFS, focusing on graph traversal and neighbor management using hash tables.

中等
207

课程表

Determine if all courses can be completed by analyzing prerequisite dependencies using indegree tracking and topological…

中等
210

课程表 II

Solve the 'Course Schedule II' problem using graph indegree and topological ordering, utilizing DFS or BFS to find the c…

中等
310

最小高度树

Identify all roots of a tree that produce minimum height using graph indegree analysis and topological trimming.

中等
329

矩阵中的最长递增路径

Find the length of the longest increasing path in a matrix with given movement constraints using graph techniques.

困难
332

重新安排行程

Reconstruct Itinerary requires building a valid travel route using all tickets once, starting from JFK with lexical orde…

困难
399

除法求值

Compute the results of division queries from given equations using graph traversal and depth-first search efficiently.

中等
547

省份数量

Solve Number of Provinces by scanning the adjacency matrix and launching DFS once per unvisited city component.

中等
684

冗余连接

Identify and remove the redundant edge that causes a cycle in a graph starting as a tree.

中等
685

冗余连接 II

Find and remove the redundant connection in a directed graph that was originally a rooted tree.

困难
743

网络延迟时间

Find the minimum time for a signal to travel to all nodes in a directed graph or determine if it's impossible.

中等
753

破解保险箱

The Cracking the Safe problem involves finding the shortest password sequence to unlock a safe using graph traversal and…

困难
765

情侣牵手

This problem requires arranging couples sitting apart in a row with the minimum number of swaps using graph traversal an…

困难
785

判断二分图

Determine whether an undirected graph can be split into two independent sets using DFS, BFS, or Union Find patterns.

中等
787

K 站中转内最便宜的航班

Find the cheapest flight from a source to a destination with at most K stops using graph traversal techniques efficientl…

中等
797

所有可能的路径

Find all paths in a directed acyclic graph (DAG) from source to target using depth-first search and backtracking.

中等
802

找到最终的安全状态

Solve the problem of finding eventual safe states in a directed graph using depth-first search and topological sorting.

中等
834

树中距离之和

The problem asks to compute the sum of distances between each node and all others in a tree structure using depth-first …

困难
841

钥匙和房间

Determine if all rooms can be visited given keys distributed across a set of interconnected locked rooms using graph tra…

中等
847

访问所有节点的最短路径

Solve the Shortest Path Visiting All Nodes problem by exploring dynamic programming, bit manipulation, and breadth-first…

困难
851

喧闹和富有

Determine the quietest person richer than each individual using graph indegree analysis and topological ordering techniq…

中等
882

细分图中的可到达节点

The Reachable Nodes In Subdivided Graph problem requires efficiently finding the reachable nodes using graph traversal a…

困难
886

可能的二分法

Determine if a group of n people with mutual dislikes can be split into two non-conflicting groups using graph traversal…

中等
913

猫和老鼠

Determine the outcome of a two-player Cat and Mouse game on a graph using topological ordering and memoized dynamic prog…

困难

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

关联高频模式

LeetCode 图题型题解:141题训练路线