# data-balanced-tree

> Efficient balanced tree implementation in TypeScript

Latest version **0.1.0** (published 2019-04-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install data-balanced-tree
pnpm add data-balanced-tree
yarn add data-balanced-tree
bun add data-balanced-tree
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2019-04-20 |
| First published | 2019-04-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 68.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Pedro M. Silva |
| Maintainers | pedromsilva |
| Keywords | js, tree, balanced, red-black, typescript, container |

## Links

- npm: https://www.npmjs.com/package/data-balanced-tree
- Repository: https://github.com/pedromsilvapt/data-balanced-tree
- Homepage: https://github.com/pedromsilvapt/data-balanced-tree#readme
- Issues: https://github.com/pedromsilvapt/data-balanced-tree/issues
- npm.io page: https://npm.io/package/data-balanced-tree

## Dependencies (1)

- [print-tree](https://npm.io/package/print-tree.md) ^0.1.4

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.0 (latest) — 2019-04-20

## README

# Balanced Tree

> Efficient balanced tree implementation in TypeScript

# Installation
```shell
npm install --save data-balanced-tree
```

# Usage
> **Note** This project comes with typescript definition files right out of the box. Type away!
```typescript
import { BalancedTree, DefaultComparators } from 'data-balanced-tree';

const tree = new BalancedTree<number>( DefaultComparators.numbers );

tree.insert( 1 );
tree.insert( 2 );
tree.insert( 4 );
tree.insert( 3 );

tree.delete( 2 );

Array.from( tree ); // [ 1, 3, 4 ]
tree.first(); // 1
tree.last(); // 4
tree.between( 1, 3 ); // Iterator 1, 3
tree.between( 2, 4, false );  // Iterator 3
tree.smallestUnder( 2 );  // 1
tree.smallestAbove( 2 ); // 3
tree.biggestAbove( 2 );  // 4
tree.biggestUnder( 2 ); // 1
```

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