I know there have been many questions similar to this one, and I've reviewed them for the past hour, however I couldn't figure out how to solve my problem using the answers provided.
My task is as follows:
Write a program that prompts the user for a list of cities, where each city has a name and x and y coordinates. After all cities have been entered, the program should use a recursive algorithm to print the length of all possible routes that start at the first city entered, end at the last city entered, and visit every city in the list. For each route, the program should print the name of each city visited, followed by length of the route.
I broke down the problem and I can figure out out most of the code. What got me stuck was finding all possible combinations between the 1st and last cities. How the hell do I manage that? I'm trying to solve it with a simple array of 5 integers and for the life of me I can't figure out how to print all combinations.
Could you kindly assist me in overcoming this hideous problem?
Thank you.