Skip to content

Commit 07d5d9e

Browse files
Create Node.java
A node class to be used for the binary tree sorting algorithm. I will put up the sorting algorithm ASAP.
1 parent a009cca commit 07d5d9e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Misc/Node.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
public class Node {
2+
public Object anElement;
3+
public Node less;
4+
public Node greater;
5+
6+
public Node(Object theElement) {
7+
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
8+
//obviously the node can still be a child of other elements
9+
}
10+
11+
public Node(Object currentElement, Node lessSide, Node greaterSide) {
12+
anElement = currentElement;
13+
this.less = lessSide;
14+
this.greater = greaterSide;
15+
}
16+
}

0 commit comments

Comments
 (0)