lab_btree
Belligerent BTrees
|
A class for the basic node structure of the BTree. More...
Public Member Functions | |
BTreeNode (bool is_leaf, unsigned int order) | |
Constructs a BTreeNode. More... | |
BTreeNode (const BTreeNode &other) | |
Constructs a BTreeNode based on another. More... | |
Public Attributes | |
bool | is_leaf |
std::vector< DataPair > | elements |
std::vector< BTreeNode * > | children |
Friends | |
std::ostream & | operator<< (std::ostream &out, const BTreeNode &n) |
Printing operator for a BTreeNode. More... | |
A class for the basic node structure of the BTree.
A node contains two vectors, one with DataPairs representing the data, and one of BTreeNode*s, representing the node's children.
|
inline |
Constructs a BTreeNode.
The vectors will reserve to avoid reallocations.
Constructs a BTreeNode based on another.
Only copies over the elements and is_leaf information.
|
friend |
Printing operator for a BTreeNode.
E.g. a node containing 4, 5, 6 would look like:
| 4 | 5 | 6 | * * * *
The stars below the bars represent non-null child pointers. Null child pointers are represented by an "N". If there are no children then "no children" is displayed instead.
out | The ostream to be written to. |
n | The node to be printed. |