[用JS來寫演算法和了解資料結構] Day10 Algorithm - Searching / Traversal
Searching / Traversal
Search
簡易搜尋/線性搜索 Sequential Search/Linear Search - O(n)
二分搜尋 Binary Search - O(log n)
Traversal
Depth First Search (DFS) 先 上到下 再 左到右 - O(n)
Breadth First Search (BFS) 先 左到右 再 上到下 - O(n)
- DFS use lower memories than BFS