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

613
views
0 answers
0 votes
rahul sharma 5 asked Dec 7, 2017
613 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...
946
views
5 answers
2 votes
Hardik Vagadia asked Nov 13, 2017
946 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.4k
views
2 answers
1 votes
aaru14 asked Dec 7, 2017
2,365 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...
Total PHP MySQL Other RAM
Time (ms) % Time (ms) % File count Time (ms) % Query count Time (ms) % Amount %
Setup 4.2 5% 2.8 3% 72 1.5 2% 2 0.0 0% 569k 43%
Control 14.8 20% 1.9 2% 4 13.3 18% 12 0.0 0% 292k 22%
View 3.4 4% 3.4 4% 12 0.0 0% 0 0.0 0% 145k 11%
Theme 45.3 62% 6.2 8% 16 39.2 53% 3 0.0 0% 312k 23%
Stats 4.9 6% 0.1 0% 0 4.8 6% 1 0.0 0% 0k 0%
Total 72.6 100% 14.4 19% 104 58.7 80% 18 0.0 0% 1321k 100%