Better method to check if a binary tree is balanced or not