Guest User

Untitled

a guest
Apr 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. node* insert(node *head, node* insertion) {
  2.     node *target = head->right, *parent = head;
  3.     for (; target != z; parent = target, target = (insertion->key < target->key) ? target->left : target->right);
  4.     return *(insertion->key < parent->key ? &parent->left : &parent->right) = insertion;
  5. }
Add Comment
Please, Sign In to add comment