+ 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?

25th Mar 2018, 7:10 PM
Naveen Kumar Maddineni
Naveen Kumar Maddineni - avatar
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
3rd Apr 2018, 7:01 PM
Ali Zhussupov
Ali Zhussupov - avatar
+ 1
sorry bro I'm a beginner. i didn't understand the program. can u plz write it without using vectors.
4th Apr 2018, 3:43 AM
Naveen Kumar Maddineni
Naveen Kumar Maddineni - avatar
+ 1
yes bro.
5th Apr 2018, 6:46 AM
Naveen Kumar Maddineni
Naveen Kumar Maddineni - avatar
+ 1
please do it using arrays
5th Apr 2018, 6:57 AM
Naveen Kumar Maddineni
Naveen Kumar Maddineni - avatar
0
Everything else is clear? (I mean except vectors). If yes, i can write it using arrays.
5th Apr 2018, 6:32 AM
Ali Zhussupov
Ali Zhussupov - avatar
6th Apr 2018, 7:58 AM
Ali Zhussupov
Ali Zhussupov - avatar