Skip to content

subrat611/leetcode-tree-visualizer

Repository files navigation

Leetcode Tree Visualizer

Don't just run your test cases through your mind, visualize them instead! 😉

Decoding characteristics of tree

  • Drawing 2D tree graphics using HTML canvas.

Representing/rendering node logic

  • A node in canvas represents these properties width, height, point (x,y), radius, and the node value.

    image

Understanding canvas height and width for tree

  • Height of the canvas

    canvas-height

  • Widht of the canvas

    canvas-width

Calculate the coordinates for placing the tree on the screen

coordinates

Draw tree recursively

Algorithm

  • Find the root node coordinates from xStart to xEnd.
  • Draw the root node on the coordinates found at step 1.
  • Recursively draw left & right nodes.
  • Connect edges of each nodes.

🔨 Technologies

  • Vitejs + TypeScript
  • Tailwind css

About

It enables you to view the tree that corresponds to the array of test cases.

Topics

Resources

Stars

Watchers

Forks

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy