0.3.2 • Published 4 years ago

@hexlet/graphs v0.3.2

Weekly downloads
13
License
ISC
Repository
github
Last release
4 years ago

js-graphs

github action status

Install

npm install @hexlet/graphs

Usage example

import {
  makeJoints, buildTreeFromLeaf, sortTree,
} from '@hexlet/graphs';

const tree = ['B', [
  ['D'],
  ['A', [
    ['C', [
      ['F'],
      ['E'],
    ]],
  ]],
]];

const joints = makeJoints(tree);
const transformed = buildTreeFromLeaf(joints);
// ['C', [
//   ['F'],
//   ['E'],
//   ['A', [
//     ['B', [
//       ['D'],
//     ]],
//   ]],
// ]];

sortTree(transformed);
// ['C', [
//   ['A', [
//     ['B', [
//       ['D'],
//     ]],
//   ]],
//   ['E'],
//   ['F'],
// ]];

For more information, see the Full Documentation

Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet (in Russian).

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago