Red-Black-Tree
This commit is contained in:
21
BinaryTree/BalanceTree/Red-Black Tree/main.cpp
Normal file
21
BinaryTree/BalanceTree/Red-Black Tree/main.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "RBTree.h"
|
||||
using namespace std;
|
||||
int main() {
|
||||
RBTree<int> t;
|
||||
//һ<><D2BB><EFBFBD><EFBFBD>עNILָ<4C><D6B8><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>Ľڵ㶼Ҫ<E3B6BC><D2AA>NIL
|
||||
t.insert(8);
|
||||
t.insert(5);
|
||||
t.insert(3);
|
||||
t.insert(2);
|
||||
t.insert(7);
|
||||
t.insert(1);
|
||||
t.inorder();
|
||||
cout << endl;
|
||||
t.erase(7);
|
||||
t.inorder();
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
1 2 3 5 7 8
|
||||
1 2 3 5 8
|
||||
*/
|
Reference in New Issue
Block a user