Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. Item* Remove(List *list, int index)
  2. {
  3. Item *p = GetItem(list, index);
  4.  
  5. if (list->head == NULL || p == NULL)
  6. return p;
  7.  
  8. if (list->head == p)
  9. list->head = p->next;
  10.  
  11. if (list->tail == p)
  12. list->tail = p->prev;
  13.  
  14. if (p->next != NULL)
  15. p->next->prev = p->prev;
  16.  
  17. if (p->prev != NULL)
  18. p->prev->next = p->next;
  19.  
  20. return p;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement