Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fathym_common/src/common/iterables/Queue.ts

The Fathym Reference Architecture provides the common foundation for applications built in Typescript.
Latest
import * as fathymCommon from "https://deno.land/x/fathym_common@v0.2.166/src/common/iterables/Queue.ts";

This is a simple implementation of a queue data structure.

Examples

From direct import

import { Queue } from "@fathym/common/iterables";

const queue = new Queue<number>();

queue.Enqueue(1);

queue.Enqueue(2);

queue.Dequeue(); // Output: 1

queue.Peek(); // Output: 2

queue.Dequeue(); // Output: 2

queue.IsEmpty(); // Output: true

From common import

import { Queue } from "@fathym/common";

const queue = new Queue<number>();

queue.Enqueue(1); // Output: 1

queue.Enqueue(2); // Output: 2

queue.Dequeue(); // Output: 1

queue.Dequeue(); // Output: 2

Classes

This is a simple implementation of a queue data structure.