Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Assume that you have a special routine that, given an array of size n, uses no comparisons to return the index of a random

image text in transcribed
1. Assume that you have a special routine that, given an array of size n, uses no comparisons to return the index of a random element whose value is in the middle third of the array. So the value of this element is between the n/3+1th and 2n/3rd smallest, inclusive. Assume that you execute quicksort with the help of this routine. (a) Estimate the number of comparisons that quicksort now uses assuming that the 5n/12th smallest element is always picked by this routine. Just get the high order term. (b) Find the high order term for the number of comparisons that quicksort now uses. To simplify the computation, you may assume that the size of a sublist is always a multiple of 3, and you may modify your summation bounds a small constant amount, but state when and how you do so. (c) Compare your estimate from Part (a) with the actual value for the high order term from Part (b) 1. Assume that you have a special routine that, given an array of size n, uses no comparisons to return the index of a random element whose value is in the middle third of the array. So the value of this element is between the n/3+1th and 2n/3rd smallest, inclusive. Assume that you execute quicksort with the help of this routine. (a) Estimate the number of comparisons that quicksort now uses assuming that the 5n/12th smallest element is always picked by this routine. Just get the high order term. (b) Find the high order term for the number of comparisons that quicksort now uses. To simplify the computation, you may assume that the size of a sublist is always a multiple of 3, and you may modify your summation bounds a small constant amount, but state when and how you do so. (c) Compare your estimate from Part (a) with the actual value for the high order term from Part (b)

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

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions