raketeFlo / reverse-linked-list-algo-rithms

Algorithm for "Algo Rithms" event

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Algo Rithms! // Reverse a linked list

1. Getting started

https://github.com/Videiraft/reverse-linked-list-algo-rithms

Fork this repo and git clone your forked repo to your computer. Once happy with your solution, git push and submit a pull request at https://github.com/Videiraft/reverse-linked-list-algo-rithms.

2. Challenge

Given a singly-linked list, reverse it iteratively or recursively. Can you get both solutions?

2.1. Example

Input: 4 -> 3 -> 2 -> 1 -> 0 -> null
Output: 0 -> 1 -> 2 -> 3 -> 4 -> null

2.2. Testing your solution

To test your solution, run npm install in the root directory and then run npm test to run the automated tests.

2.3. Submitting your solution

If you're working on a forked repo, push your changes to your forked repo and submit a pull request to this repo.

About

Algorithm for "Algo Rithms" event


Languages

Language:JavaScript 100.0%