| 424 | RBTree::RBTreeNode* RBTree::RBTreeNode::NIL = new RBTree::RBTreeNode(0, 0, RBTree::BLACK); |
| 425 | |
| 426 | int main2() |
| 427 | { |
| 428 | RBTree t; |
| 429 | int n = 100; |
| 430 | |
| 431 | for (int i = 1; i <= n; i++) { |
| 432 | printf("set %d %d\n", i, i); |
| 433 | t.set(rand() % n, i); |
| 434 | } |
| 435 | |
| 436 | for (int i = 1; i <= n; i++) { |
| 437 | printf("remove %d\n", i); |
| 438 | t.remove(i); |
| 439 | } |
| 440 | |
| 441 | for (int i = 1; i <= n; i++) { |
| 442 | t.set(i, i); |
| 443 | } |
| 444 | |
| 445 | for (int i = 1; i <= n; i++) { |
| 446 | printf("get %d %d\n", i, t.get(i)); |
| 447 | } |
| 448 | |
| 449 | return 0; |
| 450 | } |
| 451 | |
| 452 | int main() |
| 453 | { |