题库chevron_right解题模式chevron_right图·搜索
schema可复用解题模式

图·搜索模式

模式页更适合建立可迁移的解题框架。先抓识别信号,再反复练状态定义、更新规则和边界解释,能比零散刷题更快形成稳定手感。

database71 道题tune2/47/22 难度梯度category6 个关联题型

模式摘要

先识别什么

题目里常出现可以复用的状态更新节奏。

解法节奏

先口述状态和不变量,再解释每一步如何更新,最后用反例验证边界。

高频失分点

状态定义说不清,写出来也难以稳定维护。

识别信号

  • 题目里常出现可以复用的状态更新节奏。
  • 暴力枚举太慢,但结构上存在可维护的不变量。
  • 面试追问通常会盯住边界、状态变更和复杂度。

解题流程

  1. 1. 明确窗口/状态定义
  2. 2. 更新状态并维护约束
  3. 3. 用边界样例验证

常见失分点

  • 状态定义说不清,写出来也难以稳定维护。
  • 只会背模板,解释不了为什么这样更新。
  • 样例能过,但边界和复杂度追问容易崩。

推荐题单梯度

题库

图·搜索模式题库

这里更适合先按关键词或难度找题,再按关联题型切入。题库会在容器内继续滚动时慢慢续载,避免模式页被长列表一下子拉穿。

慢加载模式题库

适合先建模式理解,再扩展到完整题单。

hourglass_bottom容器内滚动续载
search
tune难度
category题型聚焦

当前展示 24 / 71 道题目

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

单词接龙

Find the shortest transformation sequence from a start word to an end word, with each word in the sequence differing by …

困难
130

被围绕的区域

Transform the matrix in-place by marking regions surrounded by 'X' as 'X', while keeping border-adjacent 'O's intact.

中等
200

岛屿数量

Count the number of distinct islands in a binary grid using array traversal combined with depth-first search exploration…

中等
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…

中等
211

添加与搜索单词 - 数据结构设计

Build a WordDictionary supporting dynamic word addition and search with wildcard matching efficiently using Trie and DFS…

中等
310

最小高度树

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

中等
365

水壶问题

Determine if two jugs with given capacities can measure an exact target amount using math and DFS strategies efficiently…

中等
386

字典序排数

Generate all numbers from 1 to n in lexicographical order using a depth-first search pattern optimized with trie logic f…

中等
407

接雨水 II

Solve Trapping Rain Water II using breadth-first search and priority queues for efficient water trapping in a matrix.

困难
417

太平洋大西洋水流问题

Find all cells on an island where water can flow to both the Pacific and Atlantic oceans using DFS or BFS.

中等
419

棋盘上的战舰

Count the number of non-overlapping battleships on a 2D board using array traversal and depth-first search patterns effi…

中等
433

最小基因变化

Determine the minimum number of single-character gene mutations to reach the target gene using BFS and a hash table look…

中等
463

岛屿的周长

Determine the perimeter of an island in a grid of land and water cells using DFS or BFS.

简单
529

扫雷游戏

Solve the Minesweeper game by updating revealed squares and handling clicks with Depth-First Search and Array manipulati…

中等
565

数组嵌套

Find the longest nested set in a permutation array using a depth-first traversal, handling cycles efficiently for medium…

中等
675

为高尔夫比赛砍树

Determine the minimum steps to cut all trees in a forest matrix in ascending height order using BFS traversal and priori…

困难
676

实现一个魔法字典

Design a Magic Dictionary to allow searching with one-character modifications, using Hash Table and String techniques.

中等
695

岛屿的最大面积

Find the largest connected land area in a binary grid using array traversal and depth-first search efficiently.

中等
733

图像渲染

Flood Fill is an array and DFS problem where you change connected pixels to a target color efficiently using recursion o…

简单
749

隔离病毒

Contain Virus involves using array-based Depth-First Search to contain viral spread by building walls around infected re…

困难
756

金字塔转换矩阵

The Pyramid Transition Matrix problem requires determining whether a pyramid can be formed with given blocks and valid p…

中等
802

找到最终的安全状态

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

中等
827

最大人工岛

Calculate the largest island size by converting at most one zero in a binary grid using array and DFS techniques efficie…

困难

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

按题型继续深入

模式学会之后,最好回到具体题型里做迁移训练。这样更容易分清楚“模式本身”和“场景变化”分别在哪里。

route

引导式练习路径

AI 会按你的当前水平推荐题目,并持续记录练习进度。

开始引导练习arrow_forward
LeetCode 图·搜索模式题解:71题训练路线