Fix linter warnings

master
Abhinav Sarkar 2019-07-05 12:38:31 +05:30
parent a1ea0f3bf3
commit 5962d43f20
1 changed files with 5 additions and 9 deletions

View File

@ -220,20 +220,16 @@ public class AVLTree<K extends Comparable<K>,V> implements Iterable<AVLTree.Entr
int balance = this.balance();
if (balance > 1) {
ValueNode<K, V> l = this.left.toValueNode();
if (l.balance() > 0) { // left-left case
return this.rotateRight();
} else { // left-right case
if (l.balance() <= 0) { // left-right case
this.left = l.rotateLeft();
return this.rotateRight();
}
return this.rotateRight();
} else if (balance < -1) {
ValueNode<K, V> r = this.right.toValueNode();
if (r.balance() > 0) { // right-left case
this.right = r.rotateRight();
return this.rotateLeft();
} else { // right-right case
return this.rotateLeft();
}
return this.rotateLeft();
}
return this;
}
@ -467,8 +463,8 @@ public class AVLTree<K extends Comparable<K>,V> implements Iterable<AVLTree.Entr
}
public static class Entry<K, V> {
private K key;
private V val;
private final K key;
private final V val;
public Entry(K key, V val) {
this.key = key;