Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Reverse Linked List (Easy 206)

Reverse a singly linked list.

Solution:

Click here

Maintain three pointers - prev, cur and next. Keep iterating over a list while changing cur pointers next and updating other pointers. O(n) time, constant space.

Installation

Run make to run python and Swift files.