JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14
  • Score
    100M100P100Q43795F
  • License MIT

Typed data structures, algorithms, and utility functions library for JavaScript/TypeScript

Package Exports

  • tsalgo

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tsalgo) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm bundle size Stargazers Issues npm GitHub Workflow Status MIT License


TsAlgo

Typed data structures, algorithms, and utility functions library for JavaScript/TypeScript
Explore the docs » NPM »

Report Bug · Request Feature

Installation

  • Install with npm
    npm install tsalgo
  • or yarn
    yarn add tsalgo

Usage

import { LinkedList } from 'tsalgo';

or import all

import * as Collections from 'tsalgo';

All implementations use TypeScript generics.

Use with TypeScript instead of JavaScript to get complete Intellisense + type-safety.

import { LinkedList } from 'tsalgo';

const ll = new LinkedList<number>();

ll.push(100); // push adds to the end of the list
ll.push(200);
ll.push(300);

// Current state = 100 -> 200 -> 300

console.log(ll.shift()); // prints 100
console.log(ll.pop()); // prints 300
console.log(ll.size); // prints 1
console.log(ll.pop()); // prints 200
console.log(ll.size); // prints 0

Roadmap

Currently supported data structures:

  • LinkedList
    • DoublyLinkedList (default)
    • SinglyLinkedList
  • Stack
  • Queue
  • Heap
    • MinHeap (default)
    • MaxHeap
  • Priority Queue (Heap based)

This is a fairly new library, but I'm adding stuff everyday. See the open issues for a list of proposed features (and known issues).

Contributing

  1. Fork the Project
  2. Create your Feature Branch ( git checkout -b feature/something)
  3. Commit your changes with commitizen (to follow semantic versioning) (yarn commit or npm run commit)
  4. Push to the Branch (git push origin feature/something)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.