1.2.2 • Published 3 years ago

@structured/binary-tree v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@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' },
// }
1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago