Deletion of Node in Circular Linked list not working

Please check why its not running
Deletion of node in Circular Linked List - All other functions are working fine only deletion is showing problem

Hello @LPLC0114,

Look at the following code from your program:

while(temp!=NULL && temp->next!=head)
{
if(temp->data==d)
{
return temp;
}
}

Where is the increment statement of the loop?

Solution:

while(temp!=NULL && temp->next!=head)
{
if(temp->data==d)
{
return temp;
}

//Modification:
temp=temp->next;
}

Hope, this would help.
Give a like, if you are satisfied.

1 Like

Thanks a lot for your support and correction.
It’s resolved now. I could not figure out on my own.
I am glad for your efforts to resolve this issue.

Anytime.:slightly_smiling_face:

Please, mark this doubt as resolved if you have no more issues regarding this problem.