Hello all, I was building a program which needs to output in alphabetical order and i got stuck.
(Program reads in text file and then do dijkstra's shortest path)
My output is fine except that it is not in alphabetical order....
can anyone help me with this???
Enter filename : qantum.txt
Enter start city : Tokyo
Cheapest price to Brussels = 700
Tokyo Paris Brussels
Cheapest price to London = 900
Tokyo Paris London
Cheapest price to Melbourne = 2200
Tokyo Paris London Sydney Melbourne
Cheapest price to New York = 500
Tokyo New York
Cheapest price to Paris = 600
Tokyo Paris
Cheapest price to Sydney = 2000
Tokyo Paris London Sydney
where the city name next to weight is should be in alphabetical order.
> where the city name next to weight is should be in alphabetical order.
What exactly do you mean by this statement? What "weight" are you referring to? And by "city name should be in alphabetical order", did you mean that the last line(for example) in your Output should look like this - "London Paris Sydney Tokyo"? If not, then try and explain your problem more clearly...
Enter filename : qantum.txt
Enter start city : Tokyo
Cheapest price to Brussels = 700
Tokyo Paris Brussels
Cheapest price to London = 900
Tokyo Paris London
Cheapest price to Melbourne = 2200
Tokyo Paris London Sydney Melbourne
Cheapest price to New York = 500
Tokyo New York
Cheapest price to Paris = 600
Tokyo Paris
Cheapest price to Sydney = 2000
Tokyo Paris London Sydney
hmm sry my english isnt perfect....
wat i mean is
those city names comes after Cheapest price to .....
Sydney New York 1300
New York Paris 1200
London Sydney 1100
Sydney London 1300
Paris New York 900
New York London 700
London Paris 200
Sydney Paris 900
Paris London 300
Brussels Paris 200
London Brussels 300
Sydney Brussels 700
Brussels New York 400
Paris Brussels 100
Tokyo New York 500
Tokyo Paris 600
Sydney Tokyo 300
Sydney Melbourne 200
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.