From 07d5d9ea6dafaa5885960d9421136d08b0706ca1 Mon Sep 17 00:00:00 2001 From: Joseph M Pignataro Date: Mon, 21 Aug 2017 13:35:38 -0400 Subject: [PATCH] Create Node.java A node class to be used for the binary tree sorting algorithm. I will put up the sorting algorithm ASAP. --- Misc/Node.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Misc/Node.java diff --git a/Misc/Node.java b/Misc/Node.java new file mode 100644 index 00000000..ab495b77 --- /dev/null +++ b/Misc/Node.java @@ -0,0 +1,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; + } +}