enum lfds710_btree_au_relative_position
Source File
└───liblfds710 └───inc └───liblfds710 lfds710_btree_addonly_unbalanced.h
Enum
enum lfds710_btree_au_relative_position { LFDS710_BTREE_AU_RELATIVE_POSITION_UP, LFDS710_BTREE_AU_RELATIVE_POSITION_LEFT, LFDS710_BTREE_AU_RELATIVE_POSITION_RIGHT, LFDS710_BTREE_AU_RELATIVE_POSITION_SMALLEST_ELEMENT_BELOW_CURRENT_ELEMENT, LFDS710_BTREE_AU_RELATIVE_POSITION_LARGEST_ELEMENT_BELOW_CURRENT_ELEMENT, LFDS710_BTREE_AU_RELATIVE_POSITION_NEXT_SMALLER_ELEMENT_IN_ENTIRE_TREE, LFDS710_BTREE_AU_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE };
Values
LFDS710_BTREE_AU_UP
- Refers to the parent element (which is NULL if performed at the root element).
LFDS710_BTREE_AU_LEFT
- Refers to the left child.
LFDS710_BTREE_AU_RIGHT
- Refers to the right child.
LFDS710_BTREE_AU_RELATIVE_POSITION_SMALLEST_ELEMENT_BELOW_CURRENT_ELEMENT
- Refers to the next smallest child element, which is to say, the rightmost child of the left child. This value does not climb the tree; it only looks for smaller children. This is NULL if there is no left child.
LFDS710_BTREE_AU_RELATIVE_POSITION_LARGEST_ELEMENT_BELOW_CURRENT_ELEMENT
- Refers to the next largest child element, which is to say, the leftmost child of the right child. This value does not climb the tree; it only looks for larger children. This is NULL if there is no right child.
LFDS710_BTREE_AU_RELATIVE_POSITION_NEXT_SMALLER_ELEMENT_IN_ENTIRE_TREE
- Refers to the next smallest element in the entire tree. As such, will climb the tree as necessary, and will not visit any elements larger than the starting element. No internal state has to be maintained to walk the tree. This is NULL when performed on the smallest element in the tree.
LFDS710_BTREE_AU_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE
- Refers to the next largest element in the entire tree. As such, will climb the tree as necessary, and will not visit any elements smaller than the starting element. No internal state has to be maintained to walk the tree. This is NULL when performed on the largest element in the tree.
Notes
This enum is used when navigating a tree. It typically is used to move a pointer to a btree element to point to another element, and so describes movements relative to the starting element.
In particular, for tree walking. lfds710_btree_au_get_by_absolute_position is used to get the smallest or largest element in the tree, and then LFDS710_BTREE_AU_RELATIVE_POSITION_NEXT_SMALLER_ELEMENT_IN_ENTIRE_TREE or LFDS710_BTREE_AU_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE (as appropriate for the direction of the walk) are repeatedly called.
A convenience function is provided which offers this functionality in a succint form, lfds710_btree_au_get_by_absolute_position_and_then_by_relative_position.