edited by
1,598 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

2 votes
2 votes
5 answers
2
Hardik Vagadia asked Nov 13, 2017
881 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 ____.
1 votes
1 votes
2 answers
3
aaru14 asked Dec 7, 2017
2,346 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...
5 votes
5 votes
2 answers
4