Hi I am new to Java so please using basic and simple Java methods that will help me quickly understand your idea.
Problem: I have n cities (each city has a unique names) and they are all connected to each other so that there is a distance between any 2 cities.
What is the best way to store those distances so later if I use name of 2 cities (since name is unique) I can retrieve distance between them?
I was thinking about using 2-D array but it doesn't seem like a good idea (possible duplication distance between A - B and B - A, also can't using city names) does it?
Why did somebody give thumb-downs to this question?