There is no "problem" with it, if it works (theoretically) and
accomplishes what you mean it to accomplish. However, as you can
probably judge, it's recursive, and that could mean a problem if your
linked list grows to be too long for the execution environment to
handle. You're going to learn about it eventually, so you might start now.
Recursion is usually organized using the process' stack (automatic
storage), which is often limited. In order to avoid putting too much
stress on the stack, it is advisable to replace recursion with a loop
whenever possible. I'll leave it to you to convert this recursive
function into a proper loop.
V
--
I do not respond to top-posted replies, please don't ask