-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (39 loc) · 1016 Bytes
/
main.cpp
File metadata and controls
40 lines (39 loc) · 1016 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
36
37
38
39
40
#include <iostream>
#include <vector>
#include <queue>
#include "RB_Tree.h"
#include "HashTable.hpp"
using namespace std;
int main() {
//RB_Tree<int> r = RB_Tree<int>(1);
//for (int i = 2; i <= 10; ++i) {
// r.Insert(i);
//}
//r.Delete(6);
//queue<RB_Tree_Node<int> *> q;
//RB_Tree_Node<int> *tmp = r.root;
//q.push(tmp);
////简陋的层序遍历
//while (!q.empty()) {
// int n = q.size();
// for (int i = 0; i < n; ++i) {
// RB_Tree_Node<int> *p = q.front();
// cout << p->data << " " << p->color<<" ";
// q.pop();
// if (p->left)
// q.push(p->left);
// if (p->right)
// q.push(p->right);
// }
// cout << "\n";
//}
//system("pause");
HashTable<int> h = *(new HashTable<int>(10));
for (int i = 1; i < 10; ++i)
h.Insert(i);
h.Delete(8);
for (int i = 1; i < 10; ++i){
cout << h.Find(i) << endl;
}
return 0;
}