TNode class

The node class deals with the fundamental unit of manipulation in our program, the venerable Node.

Node() constructor

Node *mynode = new Node;
Function Parameter(s) Return value
TNode() none pointer to the newly allocated node

Node() is the parameterless constructor that is responsible for creating a new instance of a node.

TNode() constructor

Overloaded constructor that will accept an initial integer value to be assigned to the newly allocated Node's value member.

TNode *mynode = new Node(4);
Function Parameter(s) Return value
TNode() pointer to the newly allocated node

~TNode() destructor

Destructor for TNode

delete mynode;
Function Parameter(s) Return value
~TNode() none none

copy()

copy() will duplicate the node's contents, except NULL next and prev

Function Parameter(s) Return value
notset notset notset

getRight()

getLeft() will return the value of the node to the right of the current node

Function Parameter(s) Return value
TNode *getRight() no parameters return pointer
location -> setRight(this -> location -> getRight());

getLeft()

getLeft() will return the value to the left of the current node

Function Parameter(s) Return value
TNode *getLeft() no parameters return pointer
location -> setLeft(this -> location -> getLeft());

setRight()

setRight() will set the value of the node to the right of the current node

Function Parameter(s) Return value
bool *setRight pointer value to set value of node bool status
location -> setRight(this -> location -> getRight());

setLeft()

setLeft() will set the value of the node

Function Parameter(s) Return value
TNode *setLeft pointer value to set value of node bool status
location -> setLeft(this -> location -> getLeft());