Added isBalanced() to check whether tree is balanced or not