• Home
  • Raw
  • Download

Lines Matching refs:rootp

1054 Bool avl_insert_wrk ( AvlNode**         rootp,   in avl_insert_wrk()  argument
1068 if (!(*rootp)) { in avl_insert_wrk()
1069 (*rootp) = a; in avl_insert_wrk()
1073 cmpres = kCmp( (*rootp)->key, a->key ); in avl_insert_wrk()
1077 if ((*rootp)->left) { in avl_insert_wrk()
1078 AvlNode* left_subtree = (*rootp)->left; in avl_insert_wrk()
1080 switch ((*rootp)->balance--) { in avl_insert_wrk()
1086 if ((*rootp)->left->balance < 0) { in avl_insert_wrk()
1087 avl_swr( rootp ); in avl_insert_wrk()
1088 (*rootp)->balance = 0; in avl_insert_wrk()
1089 (*rootp)->right->balance = 0; in avl_insert_wrk()
1091 avl_swl( &((*rootp)->left) ); in avl_insert_wrk()
1092 avl_swr( rootp ); in avl_insert_wrk()
1093 avl_nasty( *rootp ); in avl_insert_wrk()
1096 (*rootp)->left = left_subtree; in avl_insert_wrk()
1100 (*rootp)->left = a; in avl_insert_wrk()
1101 if ((*rootp)->balance--) in avl_insert_wrk()
1110 if ((*rootp)->right) { in avl_insert_wrk()
1111 AvlNode* right_subtree = (*rootp)->right; in avl_insert_wrk()
1113 switch((*rootp)->balance++){ in avl_insert_wrk()
1119 if ((*rootp)->right->balance > 0) { in avl_insert_wrk()
1120 avl_swl( rootp ); in avl_insert_wrk()
1121 (*rootp)->balance = 0; in avl_insert_wrk()
1122 (*rootp)->left->balance = 0; in avl_insert_wrk()
1124 avl_swr( &((*rootp)->right) ); in avl_insert_wrk()
1125 avl_swl( rootp ); in avl_insert_wrk()
1126 avl_nasty( *rootp ); in avl_insert_wrk()
1129 (*rootp)->right = right_subtree; in avl_insert_wrk()
1133 (*rootp)->right = a; in avl_insert_wrk()
1134 if ((*rootp)->balance++) in avl_insert_wrk()
1144 oldV->w = (*rootp)->val; in avl_insert_wrk()
1145 (*rootp)->val = a->val; in avl_insert_wrk()
1154 Bool avl_remove_wrk ( AvlNode** rootp, in avl_remove_wrk() argument
1159 Word cmpres = kCmp( (*rootp)->key, a->key ); in avl_remove_wrk()
1163 AvlNode* left_subtree = (*rootp)->left; in avl_remove_wrk()
1166 (*rootp)->left=left_subtree; in avl_remove_wrk()
1168 switch ((*rootp)->balance++) { in avl_remove_wrk()
1174 switch ((*rootp)->right->balance) { in avl_remove_wrk()
1176 avl_swl( rootp ); in avl_remove_wrk()
1177 (*rootp)->balance = -1; in avl_remove_wrk()
1178 (*rootp)->left->balance = 1; in avl_remove_wrk()
1181 avl_swl( rootp ); in avl_remove_wrk()
1182 (*rootp)->balance = 0; in avl_remove_wrk()
1183 (*rootp)->left->balance = 0; in avl_remove_wrk()
1190 avl_swr( &((*rootp)->right) ); in avl_remove_wrk()
1191 avl_swl( rootp ); in avl_remove_wrk()
1192 avl_nasty( *rootp ); in avl_remove_wrk()
1199 AvlNode* right_subtree = (*rootp)->right; in avl_remove_wrk()
1202 (*rootp)->right = right_subtree; in avl_remove_wrk()
1204 switch ((*rootp)->balance--) { in avl_remove_wrk()
1210 switch ((*rootp)->left->balance) { in avl_remove_wrk()
1212 avl_swr( rootp ); in avl_remove_wrk()
1213 (*rootp)->balance = 1; in avl_remove_wrk()
1214 (*rootp)->right->balance = -1; in avl_remove_wrk()
1217 avl_swr( rootp ); in avl_remove_wrk()
1218 (*rootp)->balance = 0; in avl_remove_wrk()
1219 (*rootp)->right->balance = 0; in avl_remove_wrk()
1226 avl_swl( &((*rootp)->left) ); in avl_remove_wrk()
1227 avl_swr( rootp ); in avl_remove_wrk()
1228 avl_nasty( *rootp ); in avl_remove_wrk()
1234 assert((*rootp)==a); in avl_remove_wrk()
1235 return avl_removeroot_wrk(rootp, kCmp); in avl_remove_wrk()
1244 Bool avl_removeroot_wrk ( AvlNode** rootp, in avl_removeroot_wrk() argument
1249 if (!(*rootp)->left) { in avl_removeroot_wrk()
1250 if (!(*rootp)->right) { in avl_removeroot_wrk()
1251 (*rootp) = 0; in avl_removeroot_wrk()
1254 (*rootp) = (*rootp)->right; in avl_removeroot_wrk()
1257 if (!(*rootp)->right) { in avl_removeroot_wrk()
1258 (*rootp) = (*rootp)->left; in avl_removeroot_wrk()
1261 if ((*rootp)->balance < 0) { in avl_removeroot_wrk()
1263 a = (*rootp)->left; in avl_removeroot_wrk()
1267 a = (*rootp)->right; in avl_removeroot_wrk()
1270 ch = avl_remove_wrk(rootp, a, kCmp); in avl_removeroot_wrk()
1271 a->left = (*rootp)->left; in avl_removeroot_wrk()
1272 a->right = (*rootp)->right; in avl_removeroot_wrk()
1273 a->balance = (*rootp)->balance; in avl_removeroot_wrk()
1274 (*rootp) = a; in avl_removeroot_wrk()