solved Task 4
This commit is contained in:
parent
a63689aeb0
commit
87da5e2551
|
@ -12,9 +12,10 @@ public class AVLSearchTree<T extends Comparable<T>> extends SortedBinaryTree<T>
|
||||||
|| (node.right != null && !balanced(node.right))
|
|| (node.right != null && !balanced(node.right))
|
||||||
|| (node.left != null && !balanced(node.left))){
|
|| (node.left != null && !balanced(node.left))){
|
||||||
return false;
|
return false;
|
||||||
}
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean balanced() {
|
public boolean balanced() {
|
||||||
return balanced(root);
|
return balanced(root);
|
||||||
|
|
Loading…
Reference in New Issue