Dijkstra problem C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Dijkstra problem C++

Here is my code: https://code.sololearn.com/ceaARxM8g1D6/?ref=app But I’m getting error... trying to solve the shortest path between nodes a and z. I’d include a picture of the problem but I couldn’t. I’m getting an error on line 64 saying there’s no function to call And line 19

7th May 2020, 10:04 PM
lakas
5 Answers
8th May 2020, 12:14 AM
MO ELomari
MO ELomari - avatar
0
ISO-C++ forbids VLA. you'll either need to do some raw pointer tricks or use a vector of vectors. vector of vectors approach: https://code.sololearn.com/cUM62V8DTuZ3/#cpp
7th May 2020, 11:00 PM
MO ELomari
MO ELomari - avatar
0
https://code.sololearn.com/c24oX0dMXMmM/?ref=app hi Mohamed ELomari what I’d like my output to be is like this: Vertex Distance Path A -> B 2 AB A -> C 4 AC ... ... ... ... A -> Z 16 ADFIMPSZ thank you for your help
7th May 2020, 11:14 PM
lakas
0
this is so close to what my expected output should be. but the very last vertex should be A -> Z and the first vertex should be A -> B also the out put of the distance and path is a bit off example output on the first line should be Vertex Distance Path A -> B 2 AB . . . . . A -> Z 16 ADFIMPSZ
7th May 2020, 11:58 PM
lakas
0
the first vertex is already A -> B and the very last vertex will not be A -> Z ( because V == 21 )
8th May 2020, 12:09 AM
MO ELomari
MO ELomari - avatar