+ 16
How to check if a tree is balanced or not in Java?
9 Answers
+ 4
Use a scale
+ 3
Another way is by using an AVL tree. This is a type of binary search tree that keeps itself balanced between insertions and deletions.
+ 2
there are various technique to implement tree you have to check following
1) Left subtree of T is balanced
2) Right subtree of T is balanced
3) The difference between heights of left subtree and right subtree is not more than 1.
+ 2
I needed a cashier in Java
1-number of items
2-price for each item
3-discount (1%->10%)
error handling for more or less than 1->10 (zero is okay)
4-show total
+ 2
I needed a cashier in Java
1-number of items
2-price for each item
3-discount (1%->10%)
error handling for more or less than 1->10 (zero is okay)
4-show total
+ 2
Can we use same binary tree for Mlm softwares desighn
+ 2
I am not able to do the earning report using matching in binary tree
+ 1
just by finding our the depth of the leaves. if all the leaves have the same depth then it's balanced. you need not check all the leaves if you're implementing a specific type of tree. binary or a binary search tree or an avl tree. ex - the avl tree is designed in such a way that all the leaves are at the same depth. it's always balanced.