This file is meant for educational purposes only
Using JavaScript prototype pattern, I've created an implementation of a Singly Linked Node List. The file linked_list.js
includes a Node
class, SinglyLinkedList
class, prototype methods for the SinglyLinkedList
class, and some testing of behavior that outputs results to the console.
- You can arbitrarily add and delete nodes from a singly linked list.
- Stack behavior
- push
- pop
- top
- Queue behavior
- enqueue
- dequeue
- peek
- Clone repo by running:
$ git clone git@github.com:gittheking/linked_lists.git
- Navigate into the
linked_list
directory - If you have Node installed on your machine you can run the
.js
file with
$ node linked_list.js
- Play with it and test your understanding of LL's.