Question: Determine the most accurate (+) for each function and explain how you calculated the tight bound. Assume that the functions take an input array
Determine the most accurate (+) for each function and explain how you calculated the tight bound. Assume that the functions take an input array of size n. (a) [3 points] The max method is (). 1 int max(int a, int size) 2{ 3 4 5 6 7 8 9} 5 6 7 8} (b) [3 points] The maxElement method is e( ). 1 int maxElement (int. a, int size) 2 { 3 4 4 66889SHARH5 7 10 (c) [3 points] The maxSubseqSum method is e( ). 1 int maxSubseqSum (int a, int size) 2 { 3 11 12 13 if (size < 2) 14 return -1; if (a [0] > a[1]) return a [0]; return a[1]; 15} else. int max = a[0]; for (int i=1;i max) max= return max; max=a [0]; for (int i=1;i
Step by Step Solution
There are 3 Steps involved in it
To determine the tight bounds for each function lets analyze their time complexities a max method Th... View full answer
Get step-by-step solutions from verified subject matter experts
