An open API service indexing awesome lists of open source software.

https://github.com/neuodev/doubly-linked-list

In this project; I implement a Doubly linked list using JavaScript that has the methods: remove(idx), insert(idx, val), set(idx, val), get(idx), unshift(val), shift(), pop(), push(val)
https://github.com/neuodev/doubly-linked-list

Last synced: 2 months ago
JSON representation

In this project; I implement a Doubly linked list using JavaScript that has the methods: remove(idx), insert(idx, val), set(idx, val), get(idx), unshift(val), shift(), pop(), push(val)

Awesome Lists containing this project

README

          

## Doubly Linked List

In this project I implement Doubly linked list using JavaScript

Methods: `remove(idx), insert(idx, val), set(idx, val), get(idx), unshift(val), shift(), pop(), push(val)`

- `remove(idx)` $\to$ remove node at given idx
- `insert(idx ,val)` $\to$ insert new node at idx
- `set(idx , val)` $\to$ change the value of a node at given idx
- `get(idx)` $\to$ traverse the list to reach the node and return it
- `ushift(val)` $\to$ add value to the start of the linked list
- `shift()` $\to$ remove value from the end of the linked list
- `pop()` $\to$ remove value form the end of the linked list
- `push(val)` $\to$ add new value to the end of the linked list

![Visualize linked list in action](https://github.com/AhmedIbrahim336/Doubly-Linked-List/blob/master/DLL-1.png)

![Big O of Double linked list](https://github.com/AhmedIbrahim336/Doubly-Linked-List/blob/master/DLL-2.png)