Which traversal method is more memory efficient for deep graphs?
Practice Questions
1 question
Q1
Which traversal method is more memory efficient for deep graphs?
BFS
DFS
Both are equally efficient
Neither is efficient
DFS can be more memory efficient for deep graphs because it only needs to store the current path from the root to the leaf, while BFS stores all nodes at the current level.
Questions & Step-by-step Solutions
1 item
Q
Q: Which traversal method is more memory efficient for deep graphs?
Solution: DFS can be more memory efficient for deep graphs because it only needs to store the current path from the root to the leaf, while BFS stores all nodes at the current level.