206. Reverse Linked List

Question

Reverse a singly linked list.

Quick Hints

Solution

Iterative:
Recursive:

Time complexity

O (n)

Space complexity

O(1) for iterative O(n) for recursive

Notes