LeetCode - DFS (depth-first-search) 总结

每行选一题先感受一下~

基础

Subset I, II (contain duplicates)

Combinations

Permutation I, II (contain duplicates)

Combinations Sum I, II (can only be used once), III

一维

Generate Parentheses

Letter Combination of a Phone number

Restore IP Address

Palindrome Partitioning

Remove Invalid Parentheses

Course Schedule I, II

扫描二维码关注公众号,回复: 3916424 查看本文章

Decode String

二维

Number of IslandsSurrounded Regions, Max Area of Island [标记visited]

Word Search , II; Longest Increasing Path in a Matrix

N Queens, II (基本跟I没什么区别)

Sudoku Solver

Friend Circles

Nested List Weight Sum II

Graph

Clone Graph

Is Graph Bipartite?

Reference:

https://blog.csdn.net/u011095253/article/details/9158387

猜你喜欢

转载自blog.csdn.net/real_lisa/article/details/83015074