Oracle Interview Question

reverse a linked list when head is given as input.