| 52 | } |
| 53 | |
| 54 | struct Node *Search(int key) |
| 55 | { |
| 56 | struct Node *t = root; |
| 57 | |
| 58 | while (t != NULL) |
| 59 | { |
| 60 | if (key == t->data) |
| 61 | return t; |
| 62 | else if (key < t->data) |
| 63 | t = t->lchild; |
| 64 | else |
| 65 | t = t->rchild; |
| 66 | } |
| 67 | return NULL; |
| 68 | } |
| 69 | |
| 70 | struct Node *RInsert(struct Node *p, int key) |
| 71 | { |