svgavl

command module
v0.0.0-...-d1d420d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2022 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

SvgAvl

Here is a complete GO program which reads an integer list and display an AVL tree.

Both the insertion and the drawing routine are recursives.

Finally, the program send the SVG associated with the tree to the browser to display.

Install

Select or create a folder :

cd myfloder

Clone the project into your selected folder :

git clone git@github.com:EasyGithDev/SvgAvl.git avltree

Install the depencies to work with SVG :

cd svgtree
go mod init
go get github.com/ajstarks/svgo

Run

You may execute the program with a short integer list as parameter :

go run main.go 8 5 4 3 1 -1

alt text

If you want display the node position use the -d option like this :

go run main.go -d=p 8 5 4 3 1 -1

alt text

Display the result

Open a web browser and enter the URL :

http://localhost:8000/

Write the result

You can choose to generate a SGV file to save the result.

You must change the output like this :

go run main.go -o=stdout 8 5 4 3 1 -1 > avl.svg

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址