You are on page 1of 1

General Instructions: Write your answer legibly on a 1 whole yellow

pad sheet. If you need multiple sheets, please write your name on
both sheets and staple them. Do not forget to write your name and
course section.

1. [2 pts] A = {35, 10, 12, 20, 28, 15, 18, 24}. Show/illustrate the step
by step tracing of Merge Sort in sorting the elements of array A.
2. [2 pts] Given the tracing step in #1, at most how many times will
the MERGE operation be called?
3. [5 pts] Using the same array in #1, show the step by step tracing
of QuickSort if the pivot is assumed to get the last element
always (every partition call), instead of the 1st element seen in
the algorithm shown in the lecture slides.
4. [6 pts] A 4-way mergesort is a modified mergesort algorithm
wherein a given list of size N, which instead of dividing the list
into two, it is divided evenly into 4 sublists. Give the recurrence
relation and it’s worst case time complexity.

Perfect Score is 15 points. All or nothing 

You might also like