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
.
Given a singly-linked list, reverse it iteratively or recursively. Can you get both solutions?
Input: 4 -> 3 -> 2 -> 1 -> 0 -> null
Output: 0 -> 1 -> 2 -> 3 -> 4 -> null
To test your solution, run npm install
in the root directory and then run npm test
to run the automated tests.
If you're working on a forked repo, push your changes to your forked repo and submit a pull request to this repo.