Lely core libraries 2.3.4
rbnode Struct Reference

A node in a red-black tree. More...

#include <rbtree.h>

Collaboration diagram for rbnode:

Data Fields

const void * key
 A pointer to the key for this node. More...
 
uintptr_t parent
 A pointer to the parent node. More...
 
struct rbnodeleft
 A pointer to the left child node.
 
struct rbnoderight
 A pointer to the right child node.
 

Detailed Description

A node in a red-black tree.

To associate a value with a node, embed the node in a struct containing the value and use structof() to obtain the struct from the node.

See also
rbtree

Definition at line 53 of file rbtree.h.

Field Documentation

◆ key

const void* rbnode::key

A pointer to the key for this node.

The key MUST be set before the node is inserted into a tree and MUST NOT be modified while the node is part of the tree.

Definition at line 59 of file rbtree.h.

◆ parent

uintptr_t rbnode::parent

A pointer to the parent node.

The least significant bit contains the color of this node (0 = black, 1 = red).

Definition at line 64 of file rbtree.h.


The documentation for this struct was generated from the following file: