+ 2
write a c++ program to print all possible paths from source to destination in an undirected unweighted graph.
any suggestions how to do it?
6 Answers
+ 1
You can do it using DFS.
1) Go DFS
2) Memorize current path
3) If destination reached, print current path
Implementation: https://code.sololearn.com/cuaiawSn7vIj/#cpp
+ 1
sorry bro I'm a beginner. i didn't understand the program. can u plz write it without using vectors.
+ 1
yes bro.
+ 1
please do it using arrays
0
Everything else is clear? (I mean except vectors). If yes, i can write it using arrays.
0
Here it is
https://code.sololearn.com/c536nqyLrTyf/#cpp