**New course!**Every coder should learn

**Generative AI!**

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

5 Answers

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

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

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

0

the first vertex is already A -> B
and the very last vertex will not be A -> Z ( because V == 21 )