Gator Library
An implementation of the Red-Black Tree and Priority queue data structure in C++.
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
RbtNode Class Reference

Represents a node in the red-black tree. More...

#include <redblack_tree.hpp>

Collaboration diagram for RbtNode:
Collaboration graph

Public Member Functions

 RbtNode (int k, const book &v)
 Constructs a new RbtNode object.
 
RbtNodesibling () const
 Returns the sibling of the node.
 

Public Attributes

int key
 
book value
 
RbtNodeleft
 
RbtNoderight
 
RbtNodeparent
 
Color color
 

Detailed Description

Represents a node in the red-black tree.

The RbtNode class represents a node in the red-black tree. Each node stores a key-value pair and has pointers to its left child, right child, and parent nodes. It also stores the color of the node.

Constructor & Destructor Documentation

◆ RbtNode()

RbtNode::RbtNode ( int  k,
const book v 
)
inline

Constructs a new RbtNode object.

Parameters
kThe key of the node.
vThe value associated with the key.

Member Function Documentation

◆ sibling()

RbtNode * RbtNode::sibling ( ) const

Returns the sibling of the node.

Returns
Pointer to the sibling node.

Member Data Documentation

◆ color

Color RbtNode::color

The color of the node.

◆ key

int RbtNode::key

The key of the node.

◆ left

RbtNode* RbtNode::left

Pointer to the left child node.

◆ parent

RbtNode* RbtNode::parent

Pointer to the parent node.

◆ right

RbtNode* RbtNode::right

Pointer to the right child node.

◆ value

book RbtNode::value

The value associated with the key.


The documentation for this class was generated from the following files: