A Queue is a linear data structure that follows the First In First Out (FIFO) principle. Elements are added at the back and removed from the front.
import { Queue } from "collection-kit";
import { Queue } from "collection-kit";
const queue = new Queue();
queue.enqueue(10);
queue.enqueue(20);
queue.enqueue(30);
console.log("Front element:", queue.peek()); // 10
console.log("Dequeued:", queue.dequeue()); // 10
console.log("Size:", queue.size()); // 2