Skip to content
Snippets Groups Projects
Commit 73a45277 authored by Lawrence Chung's avatar Lawrence Chung
Browse files

Node ADT edit

parent b36432e1
No related branches found
No related tags found
No related merge requests found
......@@ -2,15 +2,15 @@ package search;
//import search.RedBlackTree.Node;
public class Node<Key, Value>{
public class Node<Key, Value, T>{
private Key key;
private Value val;
private Comparable<T>[] val;
private Node left, right;
private int n;
private boolean color;
Node(Key key, Value val, int n, boolean color){
public Node(Key key, Comparable<T>[] val, int n, boolean color){
this.key = key;
this.val = val;
this.n = n;
......@@ -21,18 +21,35 @@ public class Node<Key, Value>{
return this.key;
}
public Value val(){
public void key(Key key){
this.key = key;
}
public Comparable<T>[] val(){
return this.val;
}
public void val(Value val){
this.val = val;
}
public Node left(){
return this.left;
}
public void left(Node left){
this.left = left;
}
public Node right(){
return this.right;
}
public void right(Node right){
this.right = right;
}
public int N(){
return this.n;
}
......@@ -40,4 +57,8 @@ public class Node<Key, Value>{
public boolean color(){
return this.color;
}
public void color(boolean color){
this.color = color;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment