Given a binary tree, determine if it is height-balanced.
Height-balanced binary tree : is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.
0 / 1 ( 0 for false, 1 for true ) for this problem
Input : 1 / \ 2 3 Return : True or 1 Input 2 : 3 / 2 / 1 Return : False or 0 Because for the root node, left subtree has depth 2 and right subtree has depth 0. Difference = 2 > 1.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.