@structured/binary-tree
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

@structured/binary-tree

A simple binary tree and so much more.

Installation

yarn add @structured/binary-tree

Usage

import { singleLeft } from '@structured/binary-tree';

let root = {
  data: 'a',
  right: {
    data: 'b',
    right: {
      data: 'c',
    },
  },
}

// Balance the tree with a left rotation!
root = singleLeft(root)
// {
//   data: 'b',
//   left: { data: 'a' },
//   right: { data: 'c' },
// }

Readme

Keywords

none

Package Sidebar

Install

npm i @structured/binary-tree

Weekly Downloads

0

Version

1.2.2

License

MIT

Unpacked Size

28.3 kB

Total Files

6

Last publish

Collaborators

  • shlappas