Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. (12 pts) Median of Medians Algorithm (a) (4 pts) Illustrate how to apply the QuickSelect algorithm to find the k 4th smallest element in

image text in transcribed

4. (12 pts) Median of Medians Algorithm (a) (4 pts) Illustrate how to apply the QuickSelect algorithm to find the k 4th smallest element in the given array: A [5, 3, 4, 9, 2, 8, 1, 7, 6] by showing the recursion call tree. Refer to Sam's Lecture 10 for notes on QuickSelect algorithm works (b) (4 pt) Explain in 2-3 sentences the purpose of the Median of Medians algorithm. (c) (4 pts) Consider applying Median of Medians algorithm (A Deterministic QuickSelect algorithm) to find the 4th largest element in the following array: A = [6, 10, 80, 18, 20, 82, 33, 35, 0, 31, 99, 22, 56, 3, 32, 73, 85, 29, 60, 68, 99, 23, 57, 72, 25).Illustrate how the al- gorithm would work for the first two recursive calls and indicate which sub array would the al- gorithm continue searching following the second recursion. Refer to Rachel's Lecture 8 for notes on Median of Medians Algorithm Solution: 4. (12 pts) Median of Medians Algorithm (a) (4 pts) Illustrate how to apply the QuickSelect algorithm to find the k 4th smallest element in the given array: A [5, 3, 4, 9, 2, 8, 1, 7, 6] by showing the recursion call tree. Refer to Sam's Lecture 10 for notes on QuickSelect algorithm works (b) (4 pt) Explain in 2-3 sentences the purpose of the Median of Medians algorithm. (c) (4 pts) Consider applying Median of Medians algorithm (A Deterministic QuickSelect algorithm) to find the 4th largest element in the following array: A = [6, 10, 80, 18, 20, 82, 33, 35, 0, 31, 99, 22, 56, 3, 32, 73, 85, 29, 60, 68, 99, 23, 57, 72, 25).Illustrate how the al- gorithm would work for the first two recursive calls and indicate which sub array would the al- gorithm continue searching following the second recursion. Refer to Rachel's Lecture 8 for notes on Median of Medians Algorithm Solution

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions