CSE 2320 Section 501 Fall 1998
Due: September 29, 1998, in class (September 30, 1998, 5:00pm for -10%)
- Show the operation of HEAPSORT on the array
Specifically, show the
binary-tree version of the heap and the array contents after the
initial call to BUILD-HEAP and after each call to HEAPIFY
in line 5 of the pseudocode on page 147.
- The worst-case running time T(n) of the HEAPIFY algorithm is
described by the recurrence on page 144. Use the substitution method to
- Draw a binary tree illustrating the execution of QUICKSORT on
Each node contains the subarray
passed into the recursive
calls to QUICKSORT from their parent node. The root node contains
the original array A.
- Show the operation of COUNTING-SORT on the array
Specifically, first show
the C array after completion of the for loop in lines 6-7 of
the pseudocode on page 176. Then, show the B and C array after
each iteration through the for loop in lines 9-11.
- For each of the following types of data structures, show the data
structure after each insertion of the keys 4, 7, 6, 2, 4, 3 in this order.
- Stack, using an array. Be sure to indicate the top of the
- Queue, using an array. Be sure to indicate the head and tail of the queue.
- Singly-linked list. Be sure to indicate the head of the list.
- Doubly-linked list. Be sure to indicate the head of the list.
- Doubly-linked list with sentinel. Be sure to indicate the sentinel of the list.