K Balanced Binary Tree Implementation In Python