LinkedHashNode **ptr = &bucket[hashkey];
- /* check that this key/object pair isn't already here */
- // TBD can be optimized for set v. relation */
+ for (int i = 0; i < numchildren; i++) {
+ children[i]->remove(key, data);
+ }
+
while (*ptr) {
if ((*ptr)->key == key && (*ptr)->data == data) {
LinkedHashNode *toremove=*ptr;
toremove->lnext->lprev=toremove->lprev;
delete toremove;
numelements--;
- for (int i = 0; i < numparents; i++) {
- parents[i]->add(key, data);
- }
return 1;
}
ptr = &((*ptr)->next);
}
+
return 0;
}
};
int main(int argc, char **argv) {
- struct Node * head =0;//(struct Node *) malloc(sizeof (struct Node));
- // head->next=0;
- //head->prev=0;
-
-#include "ex.cc"
+ struct Node * head =(struct Node *) malloc(sizeof (struct Node));
+ for(int i=0;i<300;i++) {
+ struct Node * tmp =(struct Node *) malloc(sizeof (struct Node));
+ tmp->next=head;
+ head->prev=tmp;
+ head=tmp;
+ }
+ for(int j=0;j<6000;j++) {
+#include "ex.cc"
+ }
}