C++ syntax help

WBahn

Joined Mar 31, 2012
32,824
Correct.

Now see if you can figure out an algorithm that let's you take a table that contains the shortest known distances from any city to the target destination and update that list with distances for cities that are just one more flight further away from any city that already has a known distance.
 

Thread Starter

arduinolego611

Joined Jan 23, 2022
75
Correct.

Now see if you can figure out an algorithm that let's you take a table that contains the shortest known distances from any city to the target destination and update that list with distances for cities that are just one more flight further away from any city that already has a known distance.
ok, before I do that, there's one thing that's been bothering me about this...is it a good idea to use, in ANY WAY, the method of matching a source to the destination of another flight in the list?

Is that how I make my table in the first place? Or is that in and of itself the problem?

Because I haven't come up with a way to find the numbers of flights that doesn't involve that at all. Maybe I just need to think harder and longer?

Like if I could blend the program to also follow the method you just described? Then I'd have my list and all I would have to do is update cities that are one flight away from the cities in the list...

Again im sorry if it seems like im not listening, I am aware that you said this would not work because of repetitions, but maybe if I framed it in another way...?
 

Thread Starter

arduinolego611

Joined Jan 23, 2022
75
Correct.

Now see if you can figure out an algorithm that let's you take a table that contains the shortest known distances from any city to the target destination and update that list with distances for cities that are just one more flight further away from any city that already has a known distance.
1. Make a table of numbers of flights from any city to BOS
2. There are 3 flights from MIA to LAX
3. There is 1 flight from LAX to BOS

4. Update BOS to 4
 

Thread Starter

arduinolego611

Joined Jan 23, 2022
75
Correct.

Now see if you can figure out an algorithm that let's you take a table that contains the shortest known distances from any city to the target destination and update that list with distances for cities that are just one more flight further away from any city that already has a known distance.
im learning about dijkstra's algorithm, seems to be leading me down the same path you were leading me down.
 
Top