Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /