For DFS and BFS should should we start at the root always in order to make sure we traverse all the nodes?
Asked
Active
Viewed 290 times
0
-
1**DFS** and **BFS** are *graph*, not just *tree* traversals, so **no**, a *tree* is only a private case of a *graph* and graph traversal can start at an arbitrary node. – dmitryro Oct 27 '20 at 23:29
1 Answers
0
No you can start on any node you like, but for each node the result can be different

Gal Sosin
- 714
- 7
- 27