0.2.3 • Published 4 months ago

ts-datastructs-algos v0.2.3

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

ts-datastructs-algos

Data structures, algorithms, and other useful functions written in TypeScript.
This package is still in development.

Usage

Install the package from npmjs.com.

    npm install ts-datastructs-algos
    bun add ts-datastructs-algos
    yarn add ts-datastructs-algos

Example

import { binarySearch } from 'ts-datastructs-algos'
const sortedArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
console.log(binarySearch(sortedArray, 5))

Exports

Algorithms

  • hasDuplicates
  • twoSums

Searches

  • binarySearch
  • linearSearch

Sorts

  • bubbleSort
  • insertionSort
  • selectionSort

Structures

  • SinglyLinkedList
  • DoublyLinkedList
  • Stack
  • Queue

Other Utilities

  • deepCopy
  • swapArrayValues

Development

Contributions are welcome!

General Rules

  1. This project is intended to be readable by developers of all levels. This is intended to help developers contribute and learn concepts. Always avoid unnecessary shorthand code.
  2. Where possible, functions should be written in a immutable way and always return something.
  3. Include type checking at the beginning of functions for when TypeScript is not used or a runtime issue occurs.
  4. ESlint is provided for consistent styling. Do not modify the .eslintrc.yml file.
  5. Create a branch for your changes, create a pull request to 'development'. Pull requests on the 'main' branch are automatically published to npm.
  6. Avoid additional dependencies at all costs.

Prerequisites

This project uses bun.sh.
Install it first if you plan on developing for this project.

Packages

Install packages with: Bun:

    bun install

Tests

Run tests with:

    bun test

Test are located in the ./tests directory.

Building

    bun run build

Note: bun build will not work.

Build files are outputed to the ./dist folder.

0.2.3

4 months ago

0.2.2

4 months ago

0.2.1

4 months ago

0.2.0

4 months ago

0.1.8

4 months ago

0.1.9

4 months ago

0.1.7

4 months ago

0.1.6

4 months ago

0.1.5

4 months ago

0.1.4

4 months ago

0.1.3

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago