Question: Use recursion to solve problem 2 of homework 3 (the swimmers problem), repeated here for reference: Four swimmers are selected to be part of the

Use recursion to solve problem 2 of homework 3 (the swimmers problem), repeated here for reference: Four swimmers are selected to be part of the team for a 4x100 medley relay race. In this race, one swimmer will swim freestyle, one breaststroke, one butterfly, and one backstroke. The times that each swimmer can do in each style are summarized in this table: Time (seconds) Breast Fly Swimmer Free Back Gary Hall 54 54 53 57 Mark Spitz Jim Montgomery Chet Jastremski 51 50 51 52 54 55 53 54 52 56 53 56 Make a program that tries all possible assignments of swimmers to styles. For each assignment, compute and print the total time of the race. Note that there are 24 different permutations possible. Find the assignment that results in the least total time. This should be done automatically by your program. Notes: The program should use recursion to generate all the swimmer permutations. The program should compute the best time automatically. The program should compute print the swim order that results in the best time automatically
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
