forked from TheAlgorithms/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.java
More file actions
16 lines (14 loc) · 542 Bytes
/
Node.java
File metadata and controls
16 lines (14 loc) · 542 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public class Node {
public Object anElement;
public Node less;
public Node greater;
public Node(Object theElement) {
this(theElement, null, null); //an empty node at the end will be by itself with no children, therefore the other 2 parameters are always null
//obviously the node can still be a child of other elements
}
public Node(Object currentElement, Node lessSide, Node greaterSide) {
anElement = currentElement;
this.less = lessSide;
this.greater = greaterSide;
}
}