package
0.0.0-20211003111303-bf095942a6eb
Repository: https://github.com/tlboright/golang-interview.git
Documentation: pkg.go.dev

# README

Reverse a Linked List

Problem Statement

Given a linked list node, Reverse a linked list.

Can you do it in O(1) space?

Questions to ask

  • Not sure what to ask for this one. It seems pretty straightforward.

Analysis

By using many pointers to prev, current, and next nodes, it works out pretty well that we can reverse the list in O(n) time and O(1) space.