Skip to content

Latest commit

 

History

History

challenge-20

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Reverse a Linked List

This problem was asked by Google.

Description

Given a singly-linked list, reverse the list.

This can be done iteratively or recursively.

Can you get both solutions?

Example

Input: 4 -> 3 -> 2 -> 1 -> 0 -> NULL
Output: 0 -> 1 -> 2 -> 3 -> 4 -> NULL