1. 程式人生 > >LeetCode - DFS (depth-first-search) 總結

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

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