| 51 | n = n->p; } } |
| 52 | inline int size() const { return sz(root); } |
| 53 | node* find(const T &item) const { |
| 54 | node *cur = root; |
| 55 | while (cur) { |
| 56 | if (cur->item < item) cur = cur->r; |
| 57 | else if (item < cur->item) cur = cur->l; |
| 58 | else break; } |
| 59 | return cur; } |
| 60 | node* insert(const T &item) { |
| 61 | node *prev = NULL, **cur = &root; |
| 62 | while (*cur) { |
no outgoing calls