0.1.0 • Published 5 years ago

print-binary-tree v0.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

Usage

  1. Prebuilt JavaScript node ./dist/print-binary-tree.js <path-to-json>
  2. Running TypeScript source code:
# with yarn:
yarn install
./node_modules/.bin/ts-node src/print-binary-tree.ts "<path-to-json>"

# with npm:
npm install
npx ts-node src/print-binary-tree.ts "<path-to-json>"
  1. Install package globally:
npm install -g .
# or
npm install -g print-binary-tree
# or
yarn global add print-binary-tree

print-binary-tree "<path-to-json>"

Data format

Tree is stored in JSON format, all nodes are array of three elements: first is number value, second and third are children, that could be either new node or null.

Examples:

[0, null, null]
[0, [1, null, null], [2, null, null]]

Other examples can be found in examples folder.

0.1.0

5 years ago