Question: 2. [Time Complexity] Assuming a valid and effective implementation, what would be the most reasonable Big-O notation for time performance of the following operations?
2. [Time Complexity] Assuming a valid and effective implementation, what would be the most reasonable Big-O notation for time performance of the following operations? State your assumptions, if any. (10%) a) Finding the maximum element in an array of integers of size n b) Finding the maximum element in a 2D array of integers of size p x q c) Finding the factorial of a number n using recursion d) Perform merge sort on an array of n numbers and then find the maximum element in the array e) Find the maximum difference between two consecutive elements in an array of size n
Step by Step Solution
3.44 Rating (151 Votes )
There are 3 Steps involved in it
A The time complexity for finding the maximum number is an array of size n is On explanation as one ... View full answer
Get step-by-step solutions from verified subject matter experts
