August 2018
Intermediate to advanced
124 pages
2h 47m
English
When recursive DFS is called on node c, the implicit stack stores two entries—one for node e, and one for nodes c and d. So, the memory used is in the order of d, where d is the depth of the search tree.
When the BFS method is called on node c, the queue contains four entries—nodes c, d, f, and g. So, the memory used is in the order of b^d, where b is the branching factor and d is the depth of the search tree. Here, the branching factor is 2, because each internal node has two children:

Read now
Unlock full access