buptsky / binary-tree-visualization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

binary-tree-visualization

Given the pre-order traversal sequence (including all empty encounters), this JavaScript program can paint the binary tree in the browser. Each non-empty node is denoted by an positive integer, and each empty node is denoted by the character '#'.

For example, if you give the following input (the first number is used to determine the size of the nodes),

32

1 2 3 # # 4 # # 5 6 7 # # 8 # # #

you will get this result:

About


Languages

Language:JavaScript 96.1%Language:HTML 3.9%