Circular linked list-delete function

given input 5 15 25 40 50 1 my code isn’t working when i want to delete 1 from circular linked list.please correct my code. the output should be 15 25 40 50

Hey @yath17 in deleteNode() function instead of taking Node pointer as a parameter you would have to take reference to pointer as a parameter.
So void deleteNode(Node *head,int data) would change to void deleteNode(Node *&head,int data).
If you still face any kind of trouble feel free to ask.

Hey @yath17 I hope I have solved your doubt if so please mark the doubt as resolved.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.