Question: 2. Your buddy wrote add method for your BSTSet class using a loop-based (iterative) algorithm. All of the other code in the class was written

 2. Your "buddy" wrote add method for your BSTSet class using

2. Your "buddy" wrote add method for your BSTSet class using a loop-based ("iterative") algorithm. All of the other code in the class was written using recursive algorithms. Your boss pointed out that if the add) method were also recursive the ability to read and debug the entire class would be greatly improved. Rewrite add) so that it uses recursion. public class BSTSet> extends AbstractSet0)(trav.leftnull)) trav.leftnew Entry (elem trav) size += 1; return true; else if (compare0) travtrav.right; else travtrav.left; return false // elem was already in Set

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!