Check if Binary Tree is Balanced

Medium Problems DSA practice problem on Onlearn.

Difficulty: medium.

Topics: Check if a Binary Tree is Balanced, Binary Tree, Recursion, Tree Traversal, Postorder Traversal, Height Calculation, complexity analysis, tree properties, divide and conquer, binary tree, postorder traversal, recursion, Tree Height & Diameter.

Balanced Binary Tree Check Problem Statement : Given the root of a binary tree, determine if it is a balanced binary tree. A balanced binary tree is defined as a tree where for every node, the absolute difference between the heights of the left and right subtrees is at most 1. Input Specification : The binary tree is represented as a level order traversal where non null nodes are represented by their integer values and null nodes are represented by 1. Output Specification : Return True if the tree is balanced, otherwise return False. Examples : Example 1 : Example 2 : Constraints : The number of nodes in the tree is in the range [0, 5000]. 10^4 <= Node.val <= 10^4 Difficulty Level : Easy to Medium