print-binary-tree

0.1.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i print-binary-tree

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

15.4 kB

Total Files

13

Last publish

Collaborators

  • 3