answer the following questions: *refer to the photo below*
Extracted text: Given a list of X objects, you want to create a program that performs the following operations: • funcl Get the first (F) and last (L) object and place them both at the start of the list. e.g. ABCDE becomes AEBCD • func2 Get the first (F) and last (L) object and place them both at the end of the list. e.g. ABCDE becomes BCDAE Assume that the size of the list will never change once initialized.Extracted text: Assume that the time complexity of funcl and func2 is O(M) and O(N), respectively. What is the time complexity of the program if: 7. we repeatedly call funcl and func2 consecutively until we find the original order of the list of X objects? Justify your answer. 8. we repeatedly call func2 until we find the original order of the list of X objects? Justify your answer. 9. we provide a list of X numbers in descending order and we want to sort it in ascending order using the two functions provided? Justify your answer.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here