Q:
You are given a pointer to a node (not the tail node) in a singly linked list. Delete that node from the linked list. Write code in C.
A:
void deleteNode( Node * node )
{
Node * temp = node->next;
node->data = node->next->data;
node->next = temp->next;
free(temp);
}
Thursday, April 22, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment