delete a head node in link list
void deleteNode(Node *head)
{
Node* temp=head;
if(head!=NULL)
{
head=head->next;
delete temp;
}
}
delete a head node in link list
void deleteNode(Node *head)
{
Node* temp=head;
if(head!=NULL)
{
head=head->next;
delete temp;
}
}
delete node from linked list
void deleteNode(struct node **head, int key)
{
//temp is used to freeing the memory
struct node *temp;
//key found on the head node.
//move to head node to the next and free the head.
if(*head->data == key)
{
temp = *head; //backup the head to free its memory
*head = (*head)->next;
free(temp);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us