- Edited
So we have a linked list of arbitrary size. A node in this list has this form:
Given a well formed list (without loops & ends with a null pointer), what is the fastest way to reverse the list?
What is the method that uses the least memory?
struct node {int data; node * next;};
in C++ speak.Given a well formed list (without loops & ends with a null pointer), what is the fastest way to reverse the list?
What is the method that uses the least memory?