BST . QUESTION_3
BSTSet
a. what is the runtime of a typical good BST size function?
b. what is we restrict the complex trees to ones
how would that effect the runtime if any?
c. Class BSTset
public static final BSTSet = Emptey = new EmptyBSTSet()
public BSTSet add (string item)
int c = item.CompareTo
if (_________){
_________
_________
} else if (__________){
____________
____________
}
__________
return ________;
}
public int size()
{__________}
// add instance variables
__________;
__________;
d. Implement size method in EmptySet
Public static class BSTSet ….
@override
Public BSTSet add(string item)
{_____________}
@override
public int size()
{_____________}
e. write a function get that works in constant time
Public class BSTSet
Public string get(int k)
if (_____________){
return________________;
} else if (___________________) {
return __________;
} else {
return _________________; }
Expert Answer
An answer
PayPal Gateway not configured
PayPal Gateway not configured