Open wupangyen opened 3 years ago
as we traverse left child we keep track of the num of left child, and afterwards as we are traverse right child we keep track of how many right child there is.
What is a Balanced Binary Tree: Summary:
at any node in the tree the height of left child and height of right child. the difference should not be more than one
Balanced Factor | height of left subtree - height of right subtree | <= 1
absolute of left height - right height
Summary: There are two approaches
Bottom Up
We can use pre order traversal: Self Node, Left Child, Right Child