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, 22.06.2019 07:30
By refraining from constructing a building until they are certain that it will not cause harm to the environment, an organization is adhering to the
Answers: 2
question
Computers and Technology, 22.06.2019 21:10
Dameas communication challenge is due to which factor
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
Helen is having a meeting with her colleagues in her company. they are working on the goals and objectives for the coming year. they want to ensure that these goals and objectives of the processes involved are properly evaluated. which system can helen and her colleagues apply to evaluate this? helen and her colleagues require a blank to evaluate the goals and objectives.
Answers: 2
question
Computers and Technology, 23.06.2019 21:40
Draw the resistor’s voltage and current phasors at t=15ms. draw the vectors with their tails at the origin. the orientation of your vectors will be graded. the exact length of your vectors will not be graded.
Answers: 2
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
Mathematics, 02.02.2020 15:45
question
Biology, 02.02.2020 15:45
Questions on the website: 13722361