-
Notifications
You must be signed in to change notification settings - Fork 0
/
No.java
74 lines (57 loc) · 1.15 KB
/
No.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package com.avl;
public class No<K, V> {
private No<K, V> left;
private No<K, V> right;
private No<K, V> father;
private K key;
private V value;
private int balance;
public No(K key, V value) {
setLeft(setRight(setFather(null)));
setBalance(0);
setKey(key);
setValue(value);
}
@Override
public String toString() {
return "No [key=" + key + ", value=" + value + "]";
}
public K getKey() {
return key;
}
public void setKey(K key) {
this.key = key;
}
public V getValue() {
return value;
}
public void setValue(V value) {
this.value = value;
}
public int getBalance() {
return balance;
}
public void setBalance(int balanceamento) {
this.balance = balanceamento;
}
public No<K, V> getFather() {
return father;
}
public No<K, V> setFather(No<K, V> father) {
this.father = father;
return father;
}
public No<K, V> getRight() {
return right;
}
public No<K ,V> setRight(No<K, V> right) {
this.right = right;
return right;
}
public No<K, V> getLeft() {
return left;
}
public void setLeft(No<K, V> left) {
this.left = left;
}
}