Answers for "delete a head node in link list"

C++
1

delete a head node in link list

void deleteNode(Node *head)
{
    Node* temp=head;
    if(head!=NULL)
    {
        head=head->next;
        delete temp;
    }
}
Posted by: Guest on March-26-2021

Browse Popular Code Answers by Language