206. Reverse Linked List
Basic linklist operation. It can be done either recursively or iteritively.
Reverse a singly linked list.
Example:
1 | Input: 1->2->3->4->5->NULL |
Follow up:
A linked list can be reversed either iteratively or recursively. Could you implement both?
Soulution:
1 | # Recursive |
1 | # iteratively |