|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Binary tree node base definitions and declaration macros. More...
Go to the source code of this file.
Classes | |
| class | BinNode< Key > |
| Basic binary node with no extra control data. More... | |
| class | BinNodeVtl< Key > |
Macros | |
| #define | CORPUS_BINNODE(name, height, Control_Data) |
| Macro to generate binary node class body. | |
| #define | DECLARE_BINNODE(name, height, Control_Data) |
| Declare a binary node class and its virtual destructor variant. | |
| #define | SET_BINNODE_nullptr_POINTER(ptr, name) |
| Initialize the static NullPtr sentinel for a node type. | |
Binary tree node base definitions and declaration macros.
This file provides macros for declaring binary tree node classes with customizable control data (balance factors, colors, priorities, etc.).
The macros generate consistent binary node structures:
DECLARE_BINNODE(name, height, Control_Data): Creates node classSET_BINNODE_nullptr_POINTER(ptr, name): Initializes sentinel pointerEach declared node class includes:
key: The stored key valuelLink, rLink: Left and right child pointersNullPtr: Static sentinel pointerMaxHeight: Maximum tree height constantDefinition in file tpl_binNodeAux.H.
| #define CORPUS_BINNODE | ( | name, | |
| height, | |||
| Control_Data | |||
| ) |
Macro to generate binary node class body.
Creates a template class with:
| name | Class name to generate |
| height | Maximum tree height (for stack sizing) |
| Control_Data | Base class with balance/color data |
Definition at line 101 of file tpl_binNodeAux.H.
| #define DECLARE_BINNODE | ( | name, | |
| height, | |||
| Control_Data | |||
| ) |
Declare a binary node class and its virtual destructor variant.
Creates two classes:
name<Key>: Basic node classnameVtl<Key>: Same with virtual destructor for polymorphism| name | Base class name |
| height | Maximum supported tree height |
| Control_Data | Base class with node-specific data |
Definition at line 165 of file tpl_binNodeAux.H.
| #define SET_BINNODE_nullptr_POINTER | ( | ptr, | |
| name | |||
| ) |
Initialize the static NullPtr sentinel for a node type.
| ptr | Pointer value for sentinel (usually nullptr) |
| name | Node class name |
Definition at line 178 of file tpl_binNodeAux.H.