Question: We create another BinaryTree as shown below: BinaryTree animals = new EmptyBinarySearchTree ( ) ; BinaryTree names; BinaryTree people = new EmptyBinarySearchTree ( ) ;

We create another BinaryTree as shown below:
BinaryTree animals = new EmptyBinarySearchTree();
BinaryTree names;
BinaryTree people = new EmptyBinarySearchTree();
people = people.add("bat");
people = people.add("rat");
people = people.add("mouse");
people = people.remove("bat");
Show an object diagram for each of the variables names, people, and animals, after this code has executed. In an Object Diagram:
If the variable is a primitive type, show its value in an oval, right next to its name (Strings and wrapper classes may be treated as primitives, to simplify the diagram)
If the variable is an object type, show its value in an oval next to its name, as an arrow (i.e. a reference) to an object, shown in a rectangle. The object should include:
The name of its class at the top (e.g. Student, BST,...) at the top
The name of each instance variable (i.e. non-static field), with its value in an oval.
Note: Strings and wrapper classes may be treated the same as primitives.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!