Optimal Binary Search Tree Program In Python