Question 3 error.

I made a mistake in describing the binary search algorithm: I got the left and the right mixed up.  Here it is again.

If the high index is less than the low index then return -1 to signify that the key is not in the array.
Otherwise look for the key in the middle of the array. 
If the element in the middle of the array is equal to the key
then return the middle index
else if the element in the middle of the array is less than the key
then repeat the search process on the sub-array to the right of the middle index
else repeat the search process on the sub-array to the left of the middle index.

I apologize for the inconvenience.


Syntax errors.

I am retracting part of instruction 5 on the exam.  I will not compile your code to check for syntax errors.  I will accept syntax errors such as typos, unintended mismatched parentheses and curly braces, missing semi-colons, and the likes.   However, I will deduct points if you do not know the key syntactic constructs such as the syntax for making visitor calls, passing appropriate parameters to method calls and to constructors, declaring classes, arrays, and the likes.  Should you want to save time, do not compile your code.

Estimate Time.


I estimate the time to do the exam to be around 3 hours.  Please remember that the time to do the exam is not the same as the time to study for the exam.  Here is the break down on each question.

1.  Counting interior nodes: 30 min.  This is very similar to counting leaf nodes, a lab exercise.  You are free to resuse that lab exercise code in any way you want.

2.a  2-3-4 tree insertion: 60 min.  There are many one-liner methods.  A lot can be completed by cut/paste from the old version.

2.b  toString(): 30 min.  This is very similar to the binary tree toString() and the draw method for the old version of Tree234.

3.  Binary search: 30 min.  This is very simple recursion that is a direct and straightforward translation of the pseudo-code.

4.  Sorting with an abstract ordering: 30 min.  There are only a few almost obvious modification to the existing sort code.

Of course, there is no time limit on the exam.  The above is just to give you some idea of how much time you should plan on.  Just relax and enjoy the learning process.

Good Luck and Have Fun!


Last revised 12/13/2000