void deleteNode(Node *ptr)
{
//creating temporary pointer
Node *temp;
//Pointing temp to link part of current node i.e. next node
temp=ptr->next;
//copy data and link part of next node to current node
ptr->data=temp->data;
//point current node to link part of next node
ptr->next=temp->next;
//Delete current node
free(temp);
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter