Question: Using Big-O where the n term is as small as possible... = (b) Consider the following 3 functions: i. Procedure: FindAAD(X, n) Set: M =

Using Big-O where the n term is as small as possible...Using Big-O where the n term is as small as possible... =

= (b) Consider the following 3 functions: i. Procedure: FindAAD(X, n) Set: M = FindMedian(X,n) Set: sum= 0 for i in 1 to n: do Set: sum = sum + ]X[i] M| end for Return: sum . Procedure: FindMADGood(X, n) Set: M FindMedian(X,n) Initialize vector Y of length n for i in 1 to n: do Set: Y [j] = |x[i] - M end for Return: FindMedian(Y,n) iii. Procedure: FindMADBad(X, n) Initialize vector Y of length n for i in 1 to n: do Set M = FindMedian(X,n) Set: Y[i] = [X[] M| end for Return: FindMedian(Y,n) What are the asymptotic runtimes of FindAAD, FindMADGood(X, n), and FindMADBad(X, n)

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!