
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

The third quiz for the course will be on Friday, July 18, during your lab session. The following list provides more information about the quiz:
The quiz will be a written quiz (no computer). Closed book, closed notes quiz. Answers must be neat and legible. We recommend that you use pencil and eraser.
The following exercises cover the material to be included in this quiz. Solutions to these exercises will not be provided, but you are welcome to discuss your solutions with the TA or instructor during office hours. We strongly recommend you do not use Eclipse to write the code associated with these exercises. Try to answer the exercises in a piece of paper and then use Eclipse to verify your solutions. This approach will better prepare you for the quiz.
Some recursion problems require an auxiliary method. For example, a recursive implementation for the tree size() method may use an auxiliary method that takes as parameter a reference to a Node. Keep this in mind when solving the problems below.
The following Java class definition for a binary search tree will be used to answer the questions that follow. Unlike project #3 the following tree is not polymorphic. Null is used to indicate an empty tree. For example, an empty BinarySearchTree has a null root, and a leaf node has null left and right fields. For this problem you may not add any variables (instance or static) to the class in order to answer the questions below.
public class BinarySearchTree <E extends Comparable