Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 221 Bytes

File metadata and controls

20 lines (13 loc) · 221 Bytes

DFS vs BFS

Depth-first Search 深度優先 Breadth-first Search 廣度優先

DFS

  1. 適合快速找出合格解

BFS

  1. 最短路徑
  2. 最佳解

DFS

  1. Stack
  2. Recursion (比較直觀)

BFS

  1. Queue