Binary Search Tree Visualizer
A Rust crate that provides visualization tools for binary search trees, including both ASCII art and SVG generation. This crate is great for educational purposes and debugging binary search tree implementations.
Features
- ASCII art visualization of binary search trees
- SVG generation for high-quality tree visualization
- Simple and intuitive API
- Customizable visualization parameters
- Support for any type that implements
OrdandDisplaytraits
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Or use:
Usage
Here's a simple example of how to use the crate:
use ;
use TreeVisualizer;
Visualization Examples
ASCII Art Output
└── 5
┌── 7
│ ┌── 9
└── 3
└── 1
SVG Output
The SVG visualization will be saved to a file and can be viewed in any web browser or SVG-compatible viewer.
Customization
The SvgVisualizer can be customized with different parameters:
let svg_viz = SvgVisualizer ;
License
This project is licensed under the MIT License - see the LICENSE file for details.