write a c++ program to print all possible paths from source to destination in an undirected unweighted graph. | SoloLearn: Learn to code for FREE!

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

3/25/2018 7:10:49 PM

Naveen Kumar Maddineni

6 Answers

New Answer

+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

+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