MCPcopy Create free account
hub / github.com/LjyYano/LeetCode / numIslands

Method numIslands

src/main/java/L0200_NumberOfIslands.java:39–60  ·  view source on GitHub ↗

DFS 深度优先搜索解法 遍历整个网格,每当遇到一个未访问的陆地时,就进行 DFS,将相连的陆地标记为已访问

(char[][] grid)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

mainMethod · 0.95

Calls 1

dfsMethod · 0.95

Tested by

no test coverage detected