subject

We are going to derive an upper bound for the average number of exchanges for quicksort. A similar analysis would give a lower bound, giving the high order term exactly. (a) Assume that the partition (or pivot) element ends up in position q. How many exchanges does partition do, NOT counting the final exchange where the pivot element is placed in its proper sorted position? Briefly justify. Note that an element can exchange with itself. (b) Write a recurrence for the expected number of exchanges (for quicksort), NOT counting the final exchange where pivot element is placed in its proper sorted position. (c) Simplify the recurrence as much as reasonably possible (as we did in class for comparisons). (d) Guess that the solution is at most an ln n for some constant a. Use constructive induction to verify the guess and derive the constant a. (e) Give an upper bound on how many exchanges involve the pivot element thoughout all of the partitions in the entire quicksort algorithm. Briefly justify.(f) Add this value to your answer in Part (d) to get an upper bound on the total number of exchanges. (g) Rewrite your solution using log base 2 rather than the natural log, evaluating the constant to three decimal places.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 23:30
Perform an online search about the booting process of a computer and list all the steps
Answers: 2
question
Computers and Technology, 24.06.2019 08:30
Why might you choose to create a functional resume
Answers: 1
question
Computers and Technology, 24.06.2019 19:20
Which command suppresses the visibility of a particular row or column in a worksheet?
Answers: 1
question
Computers and Technology, 25.06.2019 00:00
To remove text from a specific location and keep it to use again, you should select
Answers: 1
You know the right answer?
We are going to derive an upper bound for the average number of exchanges for quicksort. A similar a...
Questions
question
English, 16.12.2020 20:40
question
Mathematics, 16.12.2020 20:40
question
Geography, 16.12.2020 20:40
question
Law, 16.12.2020 20:40
Questions on the website: 13722363