• Home
  • Raw
  • Download

Lines Matching refs:root

121    AvlNode*    root;       // root node  member
204 static void avl_swl ( AvlNode** root ) in avl_swl() argument
206 AvlNode* a = *root; in avl_swl()
208 *root = b; in avl_swl()
214 static void avl_swr ( AvlNode** root ) in avl_swr() argument
216 AvlNode* a = *root; in avl_swr()
218 *root = b; in avl_swr()
224 static void avl_nasty ( AvlNode* root ) in avl_nasty() argument
226 switch (root->balance) { in avl_nasty()
228 root->left->balance = 0; in avl_nasty()
229 root->right->balance = 1; in avl_nasty()
232 root->left->balance =-1; in avl_nasty()
233 root->right->balance = 0; in avl_nasty()
236 root->left->balance = 0; in avl_nasty()
237 root->right->balance = 0; in avl_nasty()
239 root->balance = 0; in avl_nasty()
311 t->root = NULL; in VG_()
358 t->root = NULL; in VG_()
389 if (t->root) in VG_()
390 stackPush(t, t->root, 1); in VG_()
457 ? slow_cmp(t, slow_key_of_node(t, n), t->root) in cmp_key_root()
458 : fast_cmp( fast_key_of_node( n), t->root); in cmp_key_root()
469 if (t->root->left) { in avl_insert()
472 left_subtree.root = t->root->left; in avl_insert()
476 switch (t->root->balance--) { in avl_insert()
480 if (t->root->left->balance < 0) { in avl_insert()
481 avl_swr(&(t->root)); in avl_insert()
482 t->root->balance = 0; in avl_insert()
483 t->root->right->balance = 0; in avl_insert()
485 avl_swl(&(t->root->left)); in avl_insert()
486 avl_swr(&(t->root)); in avl_insert()
487 avl_nasty(t->root); in avl_insert()
490 t->root->left=left_subtree.root; in avl_insert()
494 t->root->left = n; in avl_insert()
495 if (t->root->balance--) return False; in avl_insert()
501 if (t->root->right) { in avl_insert()
504 right_subtree.root = t->root->right; in avl_insert()
508 switch (t->root->balance++) { in avl_insert()
512 if (t->root->right->balance > 0) { in avl_insert()
513 avl_swl(&(t->root)); in avl_insert()
514 t->root->balance = 0; in avl_insert()
515 t->root->left->balance = 0; in avl_insert()
517 avl_swr(&(t->root->right)); in avl_insert()
518 avl_swl(&(t->root)); in avl_insert()
519 avl_nasty(t->root); in avl_insert()
522 t->root->right=right_subtree.root; in avl_insert()
526 t->root->right = n; in avl_insert()
527 if (t->root->balance++) return False; in avl_insert()
553 if (!t->root) { in VG_()
554 t->root = n; in VG_()
578 AvlNode* curr = t->root; in avl_lookup()
657 vg_assert(t->root->left); in avl_remove()
659 left_subtree.root = t->root->left; in avl_remove()
663 t->root->left = left_subtree.root; in avl_remove()
665 switch (t->root->balance++) { in avl_remove()
669 switch (t->root->right->balance) { in avl_remove()
671 avl_swl(&(t->root)); in avl_remove()
672 t->root->balance = -1; in avl_remove()
673 t->root->left->balance = 1; in avl_remove()
676 avl_swl(&(t->root)); in avl_remove()
677 t->root->balance = 0; in avl_remove()
678 t->root->left->balance = 0; in avl_remove()
681 avl_swr(&(t->root->right)); in avl_remove()
682 avl_swl(&(t->root)); in avl_remove()
683 avl_nasty(t->root); in avl_remove()
692 vg_assert(t->root->right); in avl_remove()
694 right_subtree.root = t->root->right; in avl_remove()
698 t->root->right = right_subtree.root; in avl_remove()
700 switch (t->root->balance--) { in avl_remove()
704 switch (t->root->left->balance) { in avl_remove()
706 avl_swr(&(t->root)); in avl_remove()
707 t->root->balance = 1; in avl_remove()
708 t->root->right->balance = -1; in avl_remove()
711 avl_swr(&(t->root)); in avl_remove()
712 t->root->balance = 0; in avl_remove()
713 t->root->right->balance = 0; in avl_remove()
716 avl_swl(&(t->root->left)); in avl_remove()
717 avl_swr(&(t->root)); in avl_remove()
718 avl_nasty(t->root); in avl_remove()
726 vg_assert(t->root == n); in avl_remove()
738 if (!t->root->left) { in avl_removeroot()
739 if (!t->root->right) { in avl_removeroot()
740 t->root = NULL; in avl_removeroot()
743 t->root = t->root->right; in avl_removeroot()
746 if (!t->root->right) { in avl_removeroot()
747 t->root = t->root->left; in avl_removeroot()
750 if (t->root->balance < 0) { in avl_removeroot()
752 n = t->root->left; in avl_removeroot()
756 n = t->root->right; in avl_removeroot()
760 n->left = t->root->left; in avl_removeroot()
761 n->right = t->root->right; in avl_removeroot()
762 n->balance = t->root->balance; in avl_removeroot()
763 t->root = n; in avl_removeroot()
807 if (t->root) in VG_()
808 stackPush(t, t->root, 1); in VG_()
872 if (!oset->root) in VG_()
876 t = oset->root; in VG_()
943 OSet_Print2(t, t->root, strElem, 0); in OSet_Print()