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