I forgot to mention that I want to
implement them in C language. So, I
hope it qualifies for this group.
Sorry, no. comp.lang.c is not considered an algorithm development
newsgroup. If you have uncertainties about the meaning of some
particular C feature, or whether something is part of standard C or
is an extension, then those are good topics for comp.lang.c .
As the other posters noted, for algorithm development, comp.programming
is more appropriate.
Those have the look of homework questions.
When you take the question over to comp.programming, you should
tell them whether you want to -break- the loop, or to -delete- the
loop. You should also indicate any constraints you might be under,
such as "No available space in the node data structure" or
"Not allowed to malloc" or "The maximum number of nodes in the list is N",
or "Recursion is not allowed" or "Not allowed to use a double-linked
list to check the singly-linked list."