Homework 7

Due date: Thursday, October 27

1) Problem 7.12

2) Using the Mergesort algorithm given on the slides, sort the following array:

17, 5, 1, 30, 23, 8, 2, 11

Give the state of the array at the beginning and end of each call to mergesortRec(). Also give the values of the arguments left and right at the beginning of each call. Hint: you can safely ignore the implementation details of merge() as long as you are aware what the result of merge() is.


CS 324 Fall 2005