0.0.5 • Published 5 months ago

@mquanit/ds-lib v0.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

@mquanit/ds-lib

@mquanit/ds-lib is a TypeScript library that provides implementations of common data structures such as LinkedList and Queue.

Installation

You can install @mquanit/ds-lib using npm, yarn and pnpm:

npm install @mquanit/ds-lib

yarn add @mquanit/ds-lib

API Reference

Queue

The Queue class provides a basic implementation of a queue data structure.

import { Queue } from '@mquanit/ds-lib';

// Create a queue of strings
const myQueue = new Queue<string>();
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']

LinkedList

The LinkedList class allows you to create and manipulate a linked list.

import { LinkedList } from '@mquanit/ds-lib';

// Create a linked list of numbers
const myList = new LinkedList<number>();
myList.append(10);
myList.append(20);
myList.append(30);

// Display the linked list elements
myList.display();

Contributing

Contributions are welcome! If you have any suggestions, bug reports, or enhancements, please open an issue or submit a pull request.

License

This project is licensed under the ISC License - see the LICENSE file for details.

0.0.5

5 months ago

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago