# typedsa

> Data Structures and Algorithms in Typescript

Latest version **0.0.6** (published 2020-04-16) · 0 weekly downloads

## Install

```sh
npm install typedsa
pnpm add typedsa
yarn add typedsa
bun add typedsa
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2020-04-16 |
| First published | 2020-04-16 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 213.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | giacomocusinato |

## Links

- npm: https://www.npmjs.com/package/typedsa
- npm.io page: https://npm.io/package/typedsa

## Dependencies (2)

- [rxjs](https://npm.io/package/rxjs.md) ^6.5.5
- [bind-decorator](https://npm.io/package/bind-decorator.md) ^1.0.11

## Recent versions

- 0.0.6 (latest) — 2020-04-16
- 0.0.2 — 2020-04-16
- 0.0.1 — 2020-04-16

## README

# typedsa

> A collection of algorithms and data structures written in TypeScript.

Collection interfaces are mostly inspired by a subset of the [`System.Collection.Generics`](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic) namespace from the .NET framework.
For more information about each algorithm and data structueres, including complexity, check the TSDoc style documentation on each file.

## Installing

```
npm install --save typedsa
```

## Project Structure

The library is divided in 4 main submodules: `ds`, `algs`, `utils` and `errors`.

```
|_lib
|___algs
|_____sorting
|_______mergeSort.ts
|_______quickSort.ts
|_______...
|_______Sorter.ts
|___ds
|_____linked-list
|_____queue
|_____stack
|_____...
|_____Collection.ts
|___utils
|_____comparator
|_______Comparator.ts
|___errors
|_______BaseError.ts
|_______ArgumentNullError.ts
|_______....
```

## Usage

```typescript
import { LinkedList, DoubleLinkedList, Queue, Stack } from 'typedsa/ds';
import { Sorter } from 'typedsa/algs';
import { Comparator } from 'typedsa/utils';
import {
  BaseError,
  ArgumentNullError,
  IvalidOperationError,
} from 'typedsa/errors';

const linkedList = new LinkedList<string>();
linkedList.add('foo');
linkedList.add('bar');
linkedList.add('spam');

const stringComparator = new Comparator<string>((a: string, b: string) => {
  return a.length - b.length;
});

linkedList.sort(stringComparator);

const sortedAgain: string[] = Sorter.sort(
  linkedList.toArray(),
  SORTING_TYPES.MERGE_SORT,
  stringComparator
);
```

## Contrubuting

Althow this project has been created mostly for studying purposes, I'd love some contrubutions. Just try to be consistent with the project structure, testing, and tsdocs conventions.

### Testing

```bash
npm install

npm test
# or
npm run test:watch
# or
npm run test:coverage
```

---
_Source: https://npm.io/package/typedsa · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
