Metropoli BBS
VIEWER: avltsub4.h MODE: TEXT (ASCII)
/*Copyright (C) 1992, 1995 by Thomas Glen Smith.  All Rights Reserved.*/
/* avltsub4.h APL2 V1.0.0 **********************************************
* Included in avltree.c.                                               *
***********************************************************************/
	else /* right imbalance - symmetric to left imbalance */
		if (b->avlbf == -1) { /* rotation type rr */
			a->rite_child = b->left_child;
			b->left_child = a;
			a->avlbf = b->avlbf = 0;
		} else { /* rotation type rl */
			c = b->left_child;
			if (c == NULL) cl = cr = NULL;
			else {
				cl = c->left_child;
				cr = c->rite_child;
			}
			b->left_child = cr;
			a->rite_child = cl;
			c->rite_child = b;
			c->left_child = a;
			switch (c->avlbf) {
				case -1: /* rr(b) */
					a->avlbf = +1;
					b->avlbf = 0;
					break;
				case +1: /* rr(c) */
					b->avlbf = -1;
					a->avlbf = 0;
					break;
				default:
					b->avlbf = a->avlbf = 0;
					break;
			} /* end switch */
			c->avlbf = 0;
			b = c;
		}
[ RETURN TO DIRECTORY ]