    tree lrot( t )
    tree t;

    { tree temp;
      int a;

      temp = t;
      t = t->right;
      temp->right = t->left;
      t->left = temp;
      /*** adjust balance ***/
      a = temp->bal;
      temp->bal = a - 1 - max( t->bal, 0 );
      t->bal = min( a-2, min( a+t->bal-2, t->bal-1));
      return( t );
    }
