Starting from:

$24.99

CSC6013 - Worksheet for Week 7 Solution

Array Sum
1. Trace the recursive array sum algorithm for the following arrays. Show to each recursive call the input array, the returned value, and the number of sums executed. At the end of the trace, present the total number of sums executed (the total of sums of all recursive calls.
a. A = [38, 21, 39, 60, -1, 10, 81, 23]
b. B = [2, 97, 5, 88, 9, 72, 12, 64, 17, 56, 21]
c. C = [100, 33, 22, 213, 65, 29, 153, 199, 47, 181, 85]
Mergesort
2. Trace the Mergesort algorithm for the following arrays. Show to each recursive call the two input and output arrays.
a. A = [38, 21, 39, 60, -1, 10, 81, 23]
b. B = [2, 97, 5, 88, 9, 72, 12, 64, 17, 56, 21]
c. C = [100, 33, 22, 213, 65, 29, 153, 199, 47, 181, 85]

More products