Data Structures Assignment: Closest Value in a Binary Search Tree
In this assignment, you will create a new method called closestValue(...) that takes a value as an argument and then locates the value in the binary search tree (BST) that is closest to that argument. If the root of the tree is NULL, your method should throw an exception. You may not use an iterator for this assignment.
T BST::closestValue(T value);
For example, consider the following BST:
HINT: The value returned will come from the nodes found on the path followed, as if the parameter is getting inserted into the tree.
Attachment:- Assignment Files.rar