| 450 | } |
| 451 | |
| 452 | int main() |
| 453 | { |
| 454 | RBTree t; |
| 455 | int i, count = 3; |
| 456 | int key; |
| 457 | |
| 458 | srand(time(NULL)); |
| 459 | int arr[] = {2, 8, 4, 9, 1}; |
| 460 | for (i = 0; i < count; ++i) { |
| 461 | t.set(arr[i], i); |
| 462 | } |
| 463 | |
| 464 | for (i = 0; i < count; ++i) { |
| 465 | t.remove(arr[i]); |
| 466 | } |
| 467 | |
| 468 | return 0; |
| 469 | } |
| 470 | |
| 471 | // 0 导论翻译错误 |
| 472 | // 1 replaceChild没有设置parent |