Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- node* insert(node *head, node* insertion) {
- node *target = head->right, *parent = head;
- for (; target != z; parent = target, target = (insertion->key < target->key) ? target->left : target->right);
- return *(insertion->key < parent->key ? &parent->left : &parent->right) = insertion;
- }
Add Comment
Please, Sign In to add comment