-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRBTree.h
More file actions
35 lines (28 loc) · 778 Bytes
/
RBTree.h
File metadata and controls
35 lines (28 loc) · 778 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
35
// CSCI2720
// Project 2
// Author: Justin Rector
// RBTree.h
// This class sets up a RB tree.
#ifndef RBTREE_H
#define RBTREE_H
#include <iostream>
#include "RBNode.h"
class RBTree {
public:
RBTree();
RBTree(RBNode *, RBNode *);
RBNode * getSuccessor(RBNode *);
void RBinsert(RBTree *, int);
bool RBdelete(RBTree *, int);
void RBinorder(RBTree *);
void RBlevelorder(RBTree *);
void leftRotate(RBNode *);
void rightRotate(RBNode *);
void RBinsertFixup(RBNode *);
void RBtransplant(RBNode *, RBNode *);
void RBdeleteFixup(RBNode *);
private:
RBNode * root; //The root of the RBTree
RBNode * tNIL; //tNIL node that all nodes without a left or right child point to. It is also the root's parent.
};
#endif