Visit www.myprogramminglab.com to complete select exercises online and get instant feedback.
Exercise
Complete the definition of the binary search tree class intTree in Display by adding the following: Make IntTree implement the Cloneable interface, including the definition of a clone method; add a copy constructor; add an equals method; add a method named sameContents as described later in this project; add a toString method; and add a method to produce an iterator. Define equals so that two trees are equal if (and only if) the two trees have the exact same shape and have the same numbers in corresponding nodes. The clone method and the copy constructor should each produce a deep copy that is equal to the original list according to the equals method. The boolean valued method sameContents has one parameter of type intTree and returns true if the calling object and the argument tree contain exactly the same numbers, and returns false otherwise. Note that equals and sameContents are not the same. Also, write a suitable test program.
Display
A Binary Tree
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.