Pregunta de entrevista de Oracle

reverse a linked list when head is given as input.