Pergunta de entrevista da empresa Amazon

Reverse a singly linked list

Resposta da entrevista

Sigiloso

13 de jan. de 2012

Traverse the list once to find a pointer to the tail node. Traverse the list again and insert the current node directly after the tail node you originally found. Stop when you reach the tail node. Then, set the tail to the head.