项目作者: ahmdtaha
项目描述 :
Java code to visualize trees (e.g., BST, BTree, QuadTree)
高级语言: Java
项目地址: git://github.com/ahmdtaha/tree_viz.git
Tree Viz
Java code to visualize trees (Binary + B Tree)
TL;DR
The CompactTreeViz takes a tree-description and draws the tree in a png file. The tree-description is an ArrayList and leverages the format propose by Jim Blackler.
Sample Binary Search Tree

Sample BTree

Usage
run Main.java
from package src.tree_viz
. This is an eclipse project. After running Main.java
, png files are created in the project root directory.
TODO
- Explain how to support other trees, i.e., treeDescription
- Resize the node (width and height) dynamically based on its content.
Contributor list
While TreeViz is a one man job, I borrowed somethings from others and I want to make this clear.
- I use the tree format propose by Jim Blackler. This allows TreeViz to support any tree structure and not just binary trees.
- Since this tool is about visualization only, I borrowed the BST and the BTree implementations from mvyas85 and phishman3579, respectively.
I hope other people contribute to the TreeViz and improve it. Thus, pull requests are welcomed.
Release History
- First code commit on 16 April 2021
Misc Notes
- I developed TreeViz while TAing CMSC420 with Jason Filippou. CMSC420 is an advanced data-structures class with a lot of projects about various trees (BST, AVL, BTree, QuadTree). TreeViz is not part of the course requirements; I developed TreeViz to help me debug my implementation. TreeViz helped me visualize my trees after every insertion/deletion, i.e., find bugs faster.