Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

print-binary-tree

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

print-binary-tree

1. Prebuilt JavaScript `node ./dist/print-binary-tree.js ` 1. Running TypeScript source code:

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Usage

  • Prebuilt JavaScript node ./dist/print-binary-tree.js <path-to-json>
  • 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>"
  • 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.

FAQs

Package last updated on 03 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts