Advertisement
Guest User

wubbawubbadubdub

a guest
Oct 13th, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. typedef void* any_t;
  2.  
  3. struct _XORListNode {
  4.     any_t data;
  5.     unsigned long link;
  6. };
  7.  
  8.  
  9. _XORListNode* insert_node(_XORListNode* last){
  10.     _XORListNode *node = (_XORListNode*)malloc(sizeof(_XORListNode));
  11.    
  12.     if(last == NULL){   // Create head and return it
  13.         node->link = 0;
  14.         return node;
  15.     }
  16.    
  17.     node->link = (unsigned long)last;
  18.     last->link = last->link ^ (unsigned long) node;
  19. }
  20.  
  21.  
  22. // B            A+C (=b)            B+D(=c)         C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement