Given the following definition of a node and binary search tree, write the member functions described below. You may declare and implement more functions if you need but you need to fully code any function you call. Any function you call will calculate towards runtime of your function. Please ensure that the run time requirement is met to get full marks
class BST{ struct Node{ int data_; Node* left_; Node* right_; Node(int dat){ data_=dat; left_=right_=nullptr; } }; Node* root_; ...};
Write the following member functions of BST:
bool BST::removeSmallest(int v);
Runtime requirement O(log n) (assuming tree is balanced)
This function removes the smallest value from subtree with root value of v
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here