-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRBNode.h
More file actions
34 lines (28 loc) · 808 Bytes
/
RBNode.h
File metadata and controls
34 lines (28 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// CSCI2720
// Project 2
// Author: Justin Rector
// RBNode.h
// This class sets up a RB tree node.
#ifndef RBNODE_H
#define RBNODE_H
#include <iostream>
class RBNode {
public:
RBNode(int, RBNode *);
void setParent(RBNode *);
void setLeftChild(RBNode *);
void setRightChild(RBNode *);
void setColor(bool);
int getKey() const;
bool getColor() const;
RBNode * getParent();
RBNode * getLeftChild();
RBNode * getRightChild();
private:
int key; //The integer key attached to the node
bool color; //The color of the node. True = Red. False = Black.
RBNode * parent; //A pointer to the parent of the node
RBNode * leftChild; //A pointer to the left child of the node
RBNode * rightChild; //A pointer to the right child of the node
};
#endif