Question: Python 3 Program 2. Write a function called splay that reorganizes a list based on the first value. The first value is called the splaymaster.

Python 3 Program
2. Write a function called splay that reorganizes a list based on the first value. The first value is called the splaymaster. This function will rearrange the list such that all of the values before the splaymaster are less than or equal to the splaymaster and all of the value after it are greater than the splaymaster. The function also returns the index where the splaymaster is located. For example if the list is [8, 15, 4, 48, 26, 45, 18, 29, 2, 1], the function will rearrange it to become [2, 1, 4, 8, 26, 45, 18, 29, 48, 15] and return the value 3. You may not sort the list. Write a program that calls this function with the following test cases. Upload the results of running your program with these test cases as inputs. a. [0, 8,15, 4, 48, 26, 45, 18, 29, 2,1] b. [90, 8, 15, 4, 48, 26, 45, 18, 29, 2,1] c. [42, 5, 41,23, 45, 35, 44, 33,17, 31]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
