who can give me a solution to my doubt. It is concerning about BINARY TREES:
The theorem says:
Def 1: A binary tree is balanced if for each node it holds that the number of inner nodes in the left subtree and the number of inner nodes in the right subtree differ by at most 1.
Def 2: A binary tree is balanced if for anyI have seen two leaves the differencedefinitions of the depth is at most 1balanced binary trees, which look different to me.
A binary tree is balanced if for each node it holds that the number of inner nodes in the left subtree and the number of inner nodes in the right subtree differ by at most 1.
A binary tree is balanced if for any two leaves the difference of the depth is at most 1.
My doubt is the following: ifDoes every tree that statisfy Defsatisfies def. 1 also statisfy Defsatisfy def. 2? is that true? And this is valid also inWhat about the other way round?
Thanks for helping me!