Quiz 1, Thursday, 9/11

(20 minutes. Open notes)

  1. Suppose that an array contains the following elements (in order):
    	3  8  11  22  40  41  56  80  90  91  92.
    Further suppose that we want to perform a binary search on this array for the element 81. List, in order, all the elements of the array that 81 is compared against, by this algorithm.

  2. Add code to the delete method in the DynamicRecordDB class so that the array recordList is shrunk when it becomes too empty. More precisely, your delete method should check if, after deletion, the number of records in array recordList has fallen to less than half the size of the array. If so, the delete method should ``resize'' the array to half its current size. This piece of code would need to go at the end of the delete method. You do not have the write the whole method - just the new code.