This problem was asked by Google.
Given a singly-linked list, reverse the list.
This can be done iteratively or recursively.
Can you get both solutions?
Input: 4 -> 3 -> 2 -> 1 -> 0 -> NULL
Output: 0 -> 1 -> 2 -> 3 -> 4 -> NULL
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||