Answered step by step
Verified Expert Solution
Link Copied!

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...image text in transcribed

= (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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions