Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Absolute
- AGI
- ai
- AI agents
- AI engineer
- AI researcher
- ajax
- algorithm
- Algorithms
- aliases
- Array 객체
- ASI
- bayes' theorem
- Bit
- Blur
- BOM
- bootstrap
- canva
- challenges
- ChatGPT
Archives
- Today
- In Total
A Joyful AI Research Journey🌳😊
The differences between Depth-First Search (DFS) and Breadth-First Search (BFS) 본문
🌳Coursework ✨/Adv Algorithms & Complexity
The differences between Depth-First Search (DFS) and Breadth-First Search (BFS)
yjyuwisely 2023. 10. 25. 15:25https://www.quora.com/Are-the-majority-of-graph-algorithms-based-on-either-DFS-or-BFS
- Depth-First Search (DFS) - Left Diagram:
- Traversal Path: It starts at the root node (the top-most node) and traverses through the left subtree as deep as possible before backtracking to traverse the right subtree.
- Order of Node Exploration: The nodes are visited in the order 1, 2, 4, 6, 7, 5, 3.
- Characteristic: DFS goes deep into a tree before backtracking. It dives down a branch as far as it can before moving to the next branch.
- Breadth-First Search (BFS) - Right Diagram:
- Traversal Path: It starts at the root node and explores all neighboring nodes at the present depth before moving to nodes at the next depth level.
- Order of Node Exploration: The nodes are visited in the order 1, 2, 3, 4, 5, 6, 7.
- Characteristic: BFS explores all nodes at the current depth before proceeding to the next depth level. It's like exploring the tree level by level.
In summary, while DFS dives deep into a tree along a particular branch before backtracking, BFS explores nodes level by level. The image aptly depicts these traversal methods, making it easier to visualize and understand the differences between them.
728x90
반응형
'🌳Coursework ✨ > Adv Algorithms & Complexity' 카테고리의 다른 글
Saturated Edge (1) | 2023.10.25 |
---|---|
Textbooks: Algorithms by Sanjoy Dasgupta, Christos Papadimitriou, and Umesh Vazirani (0) | 2023.10.16 |
Comments