206 Reverse Linked List
Reverse a singly linked list.
The Idea: Reverse the next pointer of every node. Consider the following example:
Complexity: O(n) time and O(1) space
Last updated
Was this helpful?
Reverse a singly linked list.
The Idea: Reverse the next pointer of every node. Consider the following example:
Complexity: O(n) time and O(1) space
Last updated
Was this helpful?