Question: Make the following in python using recursion without using any helper functions such as max or min The function will be called sum_max_min: It will

Make the following in python using recursion without using any helper functions such as max or min

The function will be called sum_max_min: It will return the sum of the maximum and minimum elements in a given list

All functions will take a list of integers as input, all lists will have at least one element (2 in the case of second smallest).

These functions seem pretty trivial, and they are. But the trick here is that you need to implement all of them recursively. You should also try to be efficient. In particular, no function should ever need to access any element of the list more than once. (i.e, dont go through the entire list once to find the max, and again to find the min). (Hint: if its too difficult to solve a problem, think of a simpler problem you CAN solve recursively... like maybe returning a tuple of the two smallest values)

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 Databases Questions!