enum lfds700_btree_au_relative_position

From liblfds.org
Revision as of 18:33, 17 December 2015 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source File

└───liblfds700
    └───inc
        └───liblfds700
                lfds700_btree_addonly_unbalanced.h

Enum

enum lfds700_btree_au_relative_position
{
  LFDS700_BTREE_AU_RELATIVE_POSITION_UP,
  LFDS700_BTREE_AU_RELATIVE_POSITION_LEFT,
  LFDS700_BTREE_AU_RELATIVE_POSITION_RIGHT,
  LFDS700_BTREE_AU_RELATIVE_POSITION_SMALLEST_ELEMENT_BELOW_CURRENT_ELEMENT,
  LFDS700_BTREE_AU_RELATIVE_POSITION_LARGEST_ELEMENT_BELOW_CURRENT_ELEMENT,
  LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_SMALLER_ELEMENT_IN_ENTIRE_TREE,
  LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE
};

Values

LFDS700_BTREE_AU_UP

Refers to the parent element (which is NULL if performed at the root element).

LFDS700_BTREE_AU_LEFT

Refers to the left child.

LFDS700_BTREE_AU_RIGHT

Refers to the right child.

LFDS700_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.

LFDS700_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.

LFDS700_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.

LFDS700_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. lfds700_btree_au_get_by_absolute_position is used to get the smallest or largest element in the tree, and then LFDS700_BTREE_AU_RELATIVE_POSITION_NEXT_SMALLER_ELEMENT_IN_ENTIRE_TREE or LFDS700_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, lfds700_btree_au_get_by_absolute_position_and_then_by_relative_position.

See Also