Quadruply-linked node. More...
#include <Node.h>
Public Member Functions | |
void | add (T *node) |
Add node to my children. | |
void | remove () |
Remove myself from parent leaving my child branch intact. | |
void | setAsFirstChild () |
Make myself the first child. | |
void | setAsLastChild () |
Make myself the last child. | |
T * | next (const T *terminal) const |
Returns next node using depth-first traversal. | |
void | print (const char *append="") |
Print my value. | |
void | printDescendents (const char *append="") |
Print indented outline of my descendents. | |
Public Attributes | |
T * | parent |
Parent node. | |
T * | child |
Child node. | |
T * | right |
Right sibling. | |
T * | left |
Left sibling. |
Quadruply-linked node.
T * next | ( | const T * | terminal | ) | const |
Returns next node using depth-first traversal.
Returns 0 when the next node equals the terminal node.
void remove | ( | ) |
Remove myself from parent leaving my child branch intact.
This method should always be called from the instance's destructor.