`@mquanit/ds-lib` is a TypeScript library that provides implementations of common data structures such as LinkedList and Queue.
npm install @mquanit/ds-lib @mquanit/ds-lib is a TypeScript library that provides implementations of common data structures such as LinkedList and Queue.
You can install @mquanit/ds-lib using npm, yarn and pnpm:
``bash
npm install @mquanit/ds-lib
yarn add @mquanit/ds-lib
`
`javascript
import { Queue } from '@mquanit/ds-lib';
// Create a queue of strings
const myQueue = new Queue
myQueue.enqueue('apple');
myQueue.enqueue('banana');
myQueue.enqueue('orange');
// Perform operations on the queue
console.log('Front:', myQueue.front()); // Output: 'apple'
console.log('Size:', myQueue.size()); // Output: 3
myQueue.dequeue();
myQueue.printQueue(); // Output: ['banana', 'orange']
`
`javascript
import { LinkedList } from '@mquanit/ds-lib';
// Create a linked list of numbers
const myList = new LinkedList
myList.append(10);
myList.append(20);
myList.append(30);
// Display the linked list elements
myList.display();
``