Question: The following 4 methods to implement will be added to the code intSearchTree. EXERCISE 2 ( 1 pt ) : Given that you have already

The following 4 methods to implement will be added to the code "intSearchTree".
EXERCISE 2(1 pt): Given that you have already created a BST using the method add provided in the code "IntsearchTree",implement a new method addAll that takes another BST as parameter, and adds it to your original BST. Hint: you can use the method add and iterate on all elements of the new tree to be added. While running the code, the original BST is first created(given), then a second BST is created, and finally added to the first using addAll.
EXERCISE 3(2 pts): Implement a boolean method called containsAllElements that verifies if your original BST contains all elements of another given BST.
EXERCISE 4(1 pt): Implement a boolean method called equals that verifies if your original BST is equal to a given BST. Equal means both trees have exactly the same structure and the same corresponding elements (they are identical).
EXERCISE 5(1 pt):Implement a method called clear that clears a given BST. It makes the tree empty. Hint: you can write this method in roughly 1 line!

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 Programming Questions!