You are viewing a single comment's thread. Return to all comments →
thanks! nice one!
you can reduce complexity by removing while loop there, because anyway in recursion head moves as you pass newn2->next, so no need to check the condition whether it is pointing to the extreme