Skip to content

light0x00/binary-tree-printer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven Central

License: MIT

  1. add dependency
<dependency>
    <groupId>io.github.light0x00</groupId>
    <artifactId>binary-tree-printer</artifactId>
    <version>0.0.2</version>
</dependency>
  1. implement IPrintableBinaryTreeNode
@AllArgsConstructor
class BinaryTreeNode implements IPrintableBinaryTreeNode {
    //...   
}
  1. construct your tree structure then print it
BinaryTreeNode tree=buildTree();
BinaryTreePrinter.print(tree);

it will output the tree as ascii format:

      1       
     /  \     
    /    \    
   /      \   
  /        \  
  2       33  
 /  \    /  \ 
/    \  /    \
4    4  6    7

About

A tool to visualize binary tree in terminal.

Resources

Stars

Watchers

Forks

Packages