Question: Write recursive and iterative functions to find the maximum value of a binary search tree. If the tree is empty, the function should return .

Write recursive and iterative functions to find the maximum value of a binary search tree. If the tree is empty, the function should return .
int BinarySearchTree::rmax() const {
return max(root);
}
int BinarySearchTree::rmax(Node *r) const {
// returns the maximum value of the tree using recursion
}
int BinarySearchTree::imax() const {
// returns the maximum value of the tree using a loop
}(inc++)

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!