Node


The Node class represents a node in a tree.  A new Node object is created for every node in the tree.  The node contains a data field, pointers to its children, and fields that keep track of its position on the drawing panel so that it may be easily drawn.

Node for RedBlackTree also has a pointer to its parent, booleans to keep track of color, whether or not it is null, and whether or not it is a left child.

 

Method Index


public Node()

Empty constructor


for RedBlackTree:

public Node(boolean setNullNode)

Arguments:

  1. setNullNode tracks whether or not node is null

Constructor used for creating a null node which is always black.


public void displayNode()

writes the data field


for RedBlackTree:

public void equals(Node n)

Arguments:

  1. n is the node to copy

Sets fields of object node = to node n


Ted Jenks