Tuesday, March 8, 2011

Delete a node in double linked list

void deleteNode(node *n)
{
node *npre = n->prev;
node *nnext = n->next;
npre->next = n->next;
nnext->prev = n->prev;
delete n;
}

No comments:

Post a Comment