Question: Strings are read from input into list cities _ to _ pick. In create _ routes ( ) , complete the recursive case to perform

Strings are read from input into list cities_to_pick. In create_routes(), complete the recursive case to perform the following tasks for each element at index i in remain_cities:
Create a new list that contains all elements of remain_cities except the element at index i.
Create a second new list that contains all the elements in picked_cities with the element at index i added at the end of the list.
Recursively call create_routes() with the two newly created lists as the arguments.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!