Question: Write a Python function maxLessThan(root, K) , that accepts the root node of the binary search tree and a number K and returns the maximum
Write a Python function maxLessThan(root, K), that accepts the root node of the binary search tree and a number K and returns the maximum number less than or equal to K in the tree. If K is the less than every number in the tree return None . Each node in the tree is an object of class Tree , and the tree will have at least one node.
Step by Step Solution
3.33 Rating (141 Votes )
There are 3 Steps involved in it
python code class Tree def initself value leftNone rightNone selfvalue ... View full answer
Get step-by-step solutions from verified subject matter experts
