Question

When implementing a `Graph` traversal algorithm like Depth-First Search (DF

  • S recursively, what is the primary control flow mechanism that manages the order of visiting nodes and backtracking? 
A An explicit `Stack` data structure managed by the programmer.
B The implicit call stack maintained by the programming language for function calls.
C A `Queue` data structure for breadth-first exploration.
D A `for` loop iterating over all possible paths.
Practice Next

Hey! Ask a query