Pergunta de entrevista da empresa Oracle

reverse a linked list when head is given as input.