In Depth First Search (DFS), traverse the node until the leaf is reached, so if there are n nodes, the running time will be (image unavailable).
In Iterative Deepening Search (IDS), during the first iteration, the child of the root is visited first and then in the second iteration, the child of the root is visited which is at the depth 2, now at the third iteration, the child of the root is visited which is at depth 3.
The time complexity of iterative deepening is as follows:
Thus, the iterative deepening will perform worst if there is one goal or solution at the depth n and the branching factor is 1.
Please leave a comment below and share with other students in your network if you found this answer helpful. Happy learning!