Solutions of Theory of Algorithms assignment 9.3-3

Solutions of Theory of Algorithms assignment 9.3-3 -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Solutions of Theory of Algorithms Assignment 5 Exercise 9.3-3 In the worst case, quick sort running time is O(n 2 ) because the partition can be made to obtain two sets; one consists of one element and the rest is in the other set. If we could guarantee that the partitioning results two equal sets (or the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: difference is one element), then its running time will be O(nlgn). We can guarantee that by using the Select function to select the median in each iteration, then partition the array at this element....
View Full Document

Ask a homework question - tutors are online