/*
 * This code is from "Algorithms in C, Third Edition,"
 * by Robert Sedgewick, Addison Wesley Longman, 1998.
 */
void STinsert(Item item)
  { Key v = key(item); link p = head, x = p;
    if (head == z) 
      { head = NEW(item, z, z, 1); return; }
    while (x != z)
      { 
        p = x; x->N++;
        x = less(v, key(x->item)) ? x->l : x->r; 
      }
    x = NEW(item, z, z, 1);
    if (less(v, key(p->item))) p->l = x; 
                          else p->r = x;
  }
