KIDS TRIVIA

KIDS QUIZ

ROBOTS AND ARTIFICIAL INTELLIGENCE

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is the space complexity of Depth-first search?
A
O(b)
B
O(b/d)
C
O(d)
D
O(bd)
Explanation: 

Detailed explanation-1: -Space Complexity: DFS algorithm needs to store only single path from the root node, hence space complexity of DFS is equivalent to the size of the fringe set, which is O(bm).

Detailed explanation-2: -Time Complexity of BFS = O(V+E) where V is vertices and E is edges. Time Complexity of DFS is also O(V+E) where V is vertices and E is edges. BFS requires more memory space. DFS requires less memory space.

There is 1 question to complete.