daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Dec 16th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Dict::insert(itemType v, infoType info)
  2.   {
  3.     x = head; p = head; g = head;
  4.     while (x != z)
  5.       {
  6.         gg = g; g = p; p = x;
  7.         x = (v < x->key) ? x->l :  x->r;
  8.         if (x->l->b && x->r->b) split(v);
  9.       }
  10.     x = new node(v, info, 1, z, z);
  11.     if (v < p->key) p->l = x; else p->r = x;
  12.     split(v); head->r->b = black;
  13.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top