edited by
1,696 views
1 votes
1 votes

edited by

1 Answer

2 votes
2 votes
look in AVL tree, we know that both side have to be balanced, i.e balance factor -1,0,1 ..now in the question look at the line,where it is returning -1 when abs(left-right>1) means balance factor above 1 [-1 of Bf  is also 1, coz absolute is taken]

that means it is not AVL..

Note;for this kind of Code snippet,generally the if condition resembels familiar Tree properties!

Related questions

651
views
0 answers
0 votes
rahul sharma 5 asked Dec 7, 2017
651 views
True / False:-1. : The difference between the number of nodes in a binary tree that have exactly two children and the number of leaf nodes is 12. Deletion of root of AVL...
1.0k
views
5 answers
2 votes
Hardik Vagadia asked Nov 13, 2017
1,000 views
A 4-ary tree,i.e. each node has either 0 or 4 children tree has 20 leaf nodes. Then the total number of nodes in the tree are ____.
2.5k
views
2 answers
1 votes
aaru14 asked Dec 7, 2017
2,465 views
assume the preorder tŕaversal of binary tree is "abc" how many total different binary trees are possible whose postorder traversal.is "cba" with the given preorder trave...
1.4k
views
2 answers
5 votes