Domanda di colloquio di iHerb

Print all nodes from a given node in a directed graph.

Risposta di colloquio

Anonimo

2 feb 2019

Depth first search, Breadth First Search, Best First Search, anything will work. Though write the simplest one in the language of your choice: RecursiveDFS(v): ....if v is unmarked ........mark v ........print v ........for each edge vw ............RecursiveDFS(w) It is one of those algorithm problems that I would definitely classify "Very Easy".