Explanation: DFS requires node to be expanded the one most recent visited, hence stack is convenient to implement. 6. The time and space complexity of BFS is (For time and space complexity problems consider b as branching factor and d as depth of the search tree.)
A. O(bd+1) and O(bd+1)
B. O(b2) and O(d2)
C. O(d2) and O(b2)
D. O(d2) and O(d2)
Answer:A
Explanation: DFS requires node to be expanded the one most recent visited, hence stack is convenient to implement. 6. The time and space complexity of BFS is (For time and space complexity problems consider b as branching factor and d as depth of the search tree.)
A. O(bd+1) and O(bd+1) B. O(b2) and O(d2) C. O(d2) and O(b2) D. O(d2) and O(d2)