This function tests if a binary treeis perfect or not . It basically checks for two things : 1 ) All leaves are at same level 2 ) All internal nodes have two children
def isPerfectRec ( root , d , level = 0 ) : NEW_LINE