LinkedDeque
Container of elements that are inserted and removed on either side. This structure is based on DoublyLinkedList.
new LinkedDeque()
/**
* Creates an instance of LinkedDeque.
*
* @param elements List of elements to create the new queue with.
*/
constructor(elements: T[] = [])length
length: numberExamples:
import { LinkedDeque } from 'ads-js/queues';
const queue = new LinkedDeque();
queue.length === 0; // true
queue.enqueue(1);
queue.length === 1; // trueclear()
dequeue()
dequeLast()
enqueue()
enqueueFirst()
getFirst()
getLast()
isEmpty()
Returns:
Examples:
Last updated