gavra

RedBlackTree.h

May 7th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include "RBNode.h"
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. class RedBlackTree
  7. {
  8.     private:
  9.         RBNode* root;
  10.         RBNode* nil;
  11.         int key;
  12.  
  13.     protected:
  14.         void InsertFixup(RBNode* z);
  15.         void DeleteFixup(RBNode* x);
  16.         void LeftRotate(RBNode* x);
  17.         void RightRotate(RBNode* x);
  18.         RBNode* TreeSuccessor(RBNode* x);
  19.         RBNode* TreeMinimum(RBNode* x);
  20.         RBNode* TreeSearch(RBNode* x, int key);
  21.         void InorderTreeWalk(RBNode* x);
  22.  
  23.     public:
  24.         RedBlackTree();
  25.         void Insert(RBNode* z);
  26.         RBNode* Delete(RBNode* z);
  27.         void Print();
  28. };
Advertisement
Add Comment
Please, Sign In to add comment