You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/*Given a binary tree, find if it is height balanced or not. A tree is heigh balanced if difference between heights of left and right subtrees is not more than one for all nodes of tree. Expected time complexity is O(n).
A height balanced tree
1
/ \
10 39
/
5
An unbalanced tree
1
/
10
/
5
*/
struct Node {
int data;
Node* left, * right;
};
// This function should return tree if passed tree
// is balanced, else false. Time complexity should