Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DFS(int s, vertex **&G, bool *&V)
- {
- vertex *tmp;
- V[s] = true; // Zaznaczamy węzeł jako odwiedzony
- cout << " " << s; // Przetwarzamy węzeł
- // Rekurencyjnie odwiedzamy nieodwiedzonych sąsiadów
- for(tmp = G[s]; tmp; tmp = tmp->next)
- if(!V[tmp->val]) DFS(tmp->val,G,V);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement