Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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...
= (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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started