Possible Duplicate:
Reverse a singly linked list
How to reverse a singly linked list in single for loop ? This was the question which was asked in an interview .
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In pseudo code this would look like:
I know it’s not in a for loop but it can easily be rewritten to be. With the while it makes it a bit more readable.