Which algorithm is more memory efficient for deep graphs?
Practice Questions
1 question
Q1
Which algorithm is more memory efficient for deep graphs?
BFS
DFS
Both are equal
Neither is efficient
DFS is generally more memory efficient for deep graphs because it uses a stack and does not need to store all nodes at the current level like BFS does.
Questions & Step-by-step Solutions
1 item
Q
Q: Which algorithm is more memory efficient for deep graphs?
Solution: DFS is generally more memory efficient for deep graphs because it uses a stack and does not need to store all nodes at the current level like BFS does.