Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef void* any_t;
- struct _XORListNode {
- any_t data;
- unsigned long link;
- };
- _XORListNode* insert_node(_XORListNode* last){
- _XORListNode *node = (_XORListNode*)malloc(sizeof(_XORListNode));
- if(last == NULL){ // Create head and return it
- node->link = 0;
- return node;
- }
- node->link = (unsigned long)last;
- last->link = last->link ^ (unsigned long) node;
- }
- // B A+C (=b) B+D(=c) C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement