delete a head node in link list code example
Example: delete a head node in link list
void deleteNode(Node *head)
{
Node* temp=head;
if(head!=NULL)
{
head=head->next;
delete temp;
}
}
void deleteNode(Node *head)
{
Node* temp=head;
if(head!=NULL)
{
head=head->next;
delete temp;
}
}