Explanation: Queue is the most convenient data structure, but memory used to store nodes can be reduced by using circular queues. 5. Which data structure conveniently used to implement DFS?
A. Stacks
B. Queues
C. Priority Queues
D. All of the above
Answer:A
Explanation: Queue is the most convenient data structure, but memory used to store nodes can be reduced by using circular queues. 5. Which data structure conveniently used to implement DFS?
A. Stacks B. Queues C. Priority Queues D. All of the above
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.)