Given a connected list of elements (one directional), reverse it.
Respostas da entrevista
Sigiloso
8 de mar. de 2013
stat at first element, hold it in a temp variable, go to its next, also keep the 3rd as a temp variable, and reverse the 2nd to point to the 1st etc.
Sigiloso
6 de abr. de 2015
Sounds like reversing a linked list to me:
void reverseLinkList (Node *node)
{
if (node->next == null)
return;
reverseLinkList (node->next);
node->next->next = node;
}