Oh, no one answered this! :P
This is one of the questions that turned lots of people who call themselves coders in some job interviews. lol.
Here is a quick solution:
Node* ReverseList( Node ** List )
{
Node *temp1 = *List;
Node * temp2 = NULL;
Node * temp3 = NULL;
while ( temp1 )
{
*List = temp1;
temp2= temp1->pNext;
temp1->pNext = temp3;
temp3 = temp1;
temp1 = temp2;
}
return *List;
}
Try to optimize it if you could :P