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 maxroot;
int BinarySearchTree::rmaxNode 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
