Write a Python function maxLessThan(root, K) , that accepts the root node of the binary search tree
Fantastic news! We've Found the answer you've been seeking!
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 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.
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date: