self-quiz-ch6-sort-s10-ans - CS432 Algorithms Name...

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

View Full Document Right Arrow Icon
CS432, Algorithms Name: Assessment Self-Quiz for Feb. 23, 2010 Answer the questions below before the end of class and turn it in. The results you give will not count toward your grade in the class. The purpose of this test is for me to get a feel for how well the class overall understands this material, and for you to see how well you understand this material. 1) How many comparisons are done in Quicksort to combine the results from solving the subproblems? None! 2) In what sense does Partition solve a subproblem of the larger problem of sorting the entire array? In that it places the pivot element in the right position. (Partition also of course makes it trivial to combine subproblem solutions…) 3) What is the practical benefit of the fact that Partition put all items less than the pivot below the pivot and all items greater than the pivot above the pivot? We can recursively sort the sub- arrays and not have to do anything afterwards to combine these subproblem solutions. 4) Show the array after Lomuto’s partition is called:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online