Skip to content

Files

balanced-binary-tree

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 13, 2023
Mar 13, 2023

Given a binary tree, write a function to determine wheter the tree is balanced.

Sample Input

tree =    1
       /     \
      2       3
    /   \   /   \
   4     5 6     7
  /
 8

Sample Output

true

Sample Input

tree =    1
       /     \
      2       3
    /   \   /   \
   4     5 6     7
  /       /   
 8       9
        /
       10

Sample Output

false