Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.addbat;
people people.addrat;
people people.addmouse;
people people.removebat;
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 ie a reference to an object, shown in a rectangle. The object should include:
The name of its class at the top eg Student, BST at the top
The name of each instance variable ie nonstatic 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started