• Home
  • Raw
  • Download

Lines Matching refs:rootp

1065 Bool avl_insert_wrk ( AvlNode**         rootp,   in avl_insert_wrk()  argument
1079 if (!(*rootp)) { in avl_insert_wrk()
1080 (*rootp) = a; in avl_insert_wrk()
1084 cmpres = kCmp( (*rootp)->key, a->key ); in avl_insert_wrk()
1088 if ((*rootp)->left) { in avl_insert_wrk()
1089 AvlNode* left_subtree = (*rootp)->left; in avl_insert_wrk()
1091 switch ((*rootp)->balance--) { in avl_insert_wrk()
1097 if ((*rootp)->left->balance < 0) { in avl_insert_wrk()
1098 avl_swr( rootp ); in avl_insert_wrk()
1099 (*rootp)->balance = 0; in avl_insert_wrk()
1100 (*rootp)->right->balance = 0; in avl_insert_wrk()
1102 avl_swl( &((*rootp)->left) ); in avl_insert_wrk()
1103 avl_swr( rootp ); in avl_insert_wrk()
1104 avl_nasty( *rootp ); in avl_insert_wrk()
1107 (*rootp)->left = left_subtree; in avl_insert_wrk()
1111 (*rootp)->left = a; in avl_insert_wrk()
1112 if ((*rootp)->balance--) in avl_insert_wrk()
1121 if ((*rootp)->right) { in avl_insert_wrk()
1122 AvlNode* right_subtree = (*rootp)->right; in avl_insert_wrk()
1124 switch((*rootp)->balance++){ in avl_insert_wrk()
1130 if ((*rootp)->right->balance > 0) { in avl_insert_wrk()
1131 avl_swl( rootp ); in avl_insert_wrk()
1132 (*rootp)->balance = 0; in avl_insert_wrk()
1133 (*rootp)->left->balance = 0; in avl_insert_wrk()
1135 avl_swr( &((*rootp)->right) ); in avl_insert_wrk()
1136 avl_swl( rootp ); in avl_insert_wrk()
1137 avl_nasty( *rootp ); in avl_insert_wrk()
1140 (*rootp)->right = right_subtree; in avl_insert_wrk()
1144 (*rootp)->right = a; in avl_insert_wrk()
1145 if ((*rootp)->balance++) in avl_insert_wrk()
1155 oldV->w = (*rootp)->val; in avl_insert_wrk()
1156 (*rootp)->val = a->val; in avl_insert_wrk()
1165 Bool avl_remove_wrk ( AvlNode** rootp, in avl_remove_wrk() argument
1170 Word cmpres = kCmp( (*rootp)->key, a->key ); in avl_remove_wrk()
1174 AvlNode* left_subtree = (*rootp)->left; in avl_remove_wrk()
1177 (*rootp)->left=left_subtree; in avl_remove_wrk()
1179 switch ((*rootp)->balance++) { in avl_remove_wrk()
1185 switch ((*rootp)->right->balance) { in avl_remove_wrk()
1187 avl_swl( rootp ); in avl_remove_wrk()
1188 (*rootp)->balance = -1; in avl_remove_wrk()
1189 (*rootp)->left->balance = 1; in avl_remove_wrk()
1192 avl_swl( rootp ); in avl_remove_wrk()
1193 (*rootp)->balance = 0; in avl_remove_wrk()
1194 (*rootp)->left->balance = 0; in avl_remove_wrk()
1201 avl_swr( &((*rootp)->right) ); in avl_remove_wrk()
1202 avl_swl( rootp ); in avl_remove_wrk()
1203 avl_nasty( *rootp ); in avl_remove_wrk()
1210 AvlNode* right_subtree = (*rootp)->right; in avl_remove_wrk()
1213 (*rootp)->right = right_subtree; in avl_remove_wrk()
1215 switch ((*rootp)->balance--) { in avl_remove_wrk()
1221 switch ((*rootp)->left->balance) { in avl_remove_wrk()
1223 avl_swr( rootp ); in avl_remove_wrk()
1224 (*rootp)->balance = 1; in avl_remove_wrk()
1225 (*rootp)->right->balance = -1; in avl_remove_wrk()
1228 avl_swr( rootp ); in avl_remove_wrk()
1229 (*rootp)->balance = 0; in avl_remove_wrk()
1230 (*rootp)->right->balance = 0; in avl_remove_wrk()
1237 avl_swl( &((*rootp)->left) ); in avl_remove_wrk()
1238 avl_swr( rootp ); in avl_remove_wrk()
1239 avl_nasty( *rootp ); in avl_remove_wrk()
1245 assert((*rootp)==a); in avl_remove_wrk()
1246 return avl_removeroot_wrk(rootp, kCmp); in avl_remove_wrk()
1255 Bool avl_removeroot_wrk ( AvlNode** rootp, in avl_removeroot_wrk() argument
1260 if (!(*rootp)->left) { in avl_removeroot_wrk()
1261 if (!(*rootp)->right) { in avl_removeroot_wrk()
1262 (*rootp) = 0; in avl_removeroot_wrk()
1265 (*rootp) = (*rootp)->right; in avl_removeroot_wrk()
1268 if (!(*rootp)->right) { in avl_removeroot_wrk()
1269 (*rootp) = (*rootp)->left; in avl_removeroot_wrk()
1272 if ((*rootp)->balance < 0) { in avl_removeroot_wrk()
1274 a = (*rootp)->left; in avl_removeroot_wrk()
1278 a = (*rootp)->right; in avl_removeroot_wrk()
1281 ch = avl_remove_wrk(rootp, a, kCmp); in avl_removeroot_wrk()
1282 a->left = (*rootp)->left; in avl_removeroot_wrk()
1283 a->right = (*rootp)->right; in avl_removeroot_wrk()
1284 a->balance = (*rootp)->balance; in avl_removeroot_wrk()
1285 (*rootp) = a; in avl_removeroot_wrk()