node package for top and bottom plus lifo/ fifo queues, stack, priority queues, double ended queues, circular queues, wait queues (TODO), and semaphore queues (TODO) implementation
Find the demos in the demos folder
Commonjs Code
var queues = require("queues.js");
var Queue = require("queues.js").Queue;
var QueueFifo = require("queues.js").QueueFifo;
var QueueLifo = require("queues.js").QueueLifo;
var queue = new Queue();
var fifo = new QueueFifo();
var lifo = new QueueLifo();
import { default as queues, QueueLifo, QueueFifo } as "queues.js";
var fifo = new QueueFifo();
var lifo = new QueueLifo();
var queues = import("queues.js");
var QueueFifo = import("queues.js").QueueFifo;
var QueueLifo = import("queues.js").QueueLifo;
var fifo = new QueueFifo();
var lifo = new QueueLifo();
- Queue - Persistent Queue (stores the queue value at its place - uses a offset)
- QueueLowFootprint - Non-Persistent Queue (releases the queue value from its place permanently - use value once)
- All LowFootprint names classes / functions are non-persistent queues
const { Queue, QueueLowFootprint, QueueLifo, QueueFifo, QueueLowFootprintLifo, QueueLowFootprintFifo, AsyncQueue, AsyncQueueLowFootprint } = require("queues.js");
const { QueueTop, QueueTopLowFootprint, QueueTopLifo, QueueTopFifo, QueueTopLowFootprintLifo, QueueTopLowFootprintFifo, AsyncQueueTop, AsyncQueueTopLowFootprint } = require("queues.js");
const { Stack, StackLowFootprint, AsyncStack, AsyncStackLowFootprint } = require("queues.js");
const { DoubleEnded, DoubleEndedLowFootprint, AsyncDoubleEnded, AsyncDoubleEndedLowFootprint } = require("queues.js");
In development
const { Semaphore } = require("queues.js");
In development
const { WaitQueue } = require("queues.js");
const { Priority, PriorityLowFootprint, AsyncPriority, AsyncPriorityLowFootprint } = require("queues.js");
In development - Currently Testing
const { Circular, AsyncCircular } = require("queues.js");
//
// FIFO BOTTOM QUEUE IMPLEMENTATION
//
// <== [1,2,3,4] <==
//
var queues = require("queues.js");
var QueueFifo = require("queues.js").QueueFifo;
var fifo = new QueueFifo();
fifo.enqueue(item);
fifo.add(item);
fifo.insert(item);
fifo.push(item);
fifo.dequeue();
fifo.shift();
fifo.remove();
//
// LIFO BOTTOM QUEUE IMPLEMENTATION
//
// <==
// [1,2,3,4]
// ==>
//
var queues = require("queues.js");
var QueueLifo = require("queues.js").QueueLifo;
var lifo = new QueueLifo();
lifo.enqueue(item);
lifo.add(item);
lifo.push(item);
lifo.insert(item);
lifo.dequeue();
lifo.pop();
lifo.remove();
.todo In Development: Asynchronous Implementation, Semphores, Wait Queues
Contributions, Feature Improvements, Bugs, and Issues are invited. raising an issue