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); }