Skip to content

Files

Latest commit

c95f9b3 · Oct 21, 2022

History

History
25 lines (14 loc) · 1.05 KB

README.md

File metadata and controls

25 lines (14 loc) · 1.05 KB

Binary Tree Visualization

A simple web application to visualize a binary tree given it's level order string representation.

Click here to try it out.

Working

To space out the nodes, a simple algorithm is used where the positions of the leaf nodes in the last level are calculated by equally spacing them by a constant factor. In this calculation, the null nodes are also considered as if they were present in the representation of a fully complete binary tree of the same height.

Running Locally

Node is required to run the project locally. To run locally,

  1. Clone the repository.
  2. Run yarn or npm i (if using npm) in the root directory of the project.
  3. Start the development server using yarn start or npm start.

By default, parcel serves the app at http://localhost:1234

Building The App

Build the app using yarn build or npm build command. The files to be served can be found inside the generated dist folder post build.