We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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
Insert a Node at the Tail of a Linked List
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