README
Deque Data Structure
In computer science, a double-ended queue (abbreviated to deque, pronounced deck, like "cheque"[1]) is an abstract data type that generalizes a queue, for which elements can be added to or removed from either the front (head) or back (tail).[2] It is also often called a head-tail linked list, though properly this refers to a specific data structure implementation of a deque (see below).In computer science, a double-ended queue (abbreviated to deque, pronounced deck, like "cheque"[1]) is an abstract data type that generalizes a queue, for which elements can be added to or removed from either the front (head) or back (tail).[2] It is also often called a head-tail linked list, though properly this refers to a specific data structure implementation of a deque (see below).
Table of Content
Usage
npm i @amirho/deque
import and use it simple
import Deque from "@amirho/Deque";
const deque = new Deque();
deque.isEmpty(); // true
deque.addFront("javascript");
deque.isEmpty(); // false
deque.size; // 1
deque.removeFront(); // returns javascript
deque.addBack("vue");
deque.addBack("react");
deque.removeBack(); //returns react
deque.clear(); // removes all element
deque.size; // 0
you can test it also
npm test
license
MIT
Author
AmirHossein Salighedar