Svg data structure grapher.
With proprietary implementations of data structures, which meet the complexity in time and space.
The program makes use of the MAVEN 3.8.6 or higher packager.
- Linux.
https://maven.apache.org/download.cgi
- Clone the repository.
git clone https://github.com/richardfm77/svg-data-structure-grapher.git
cd svg-data-structure-grapher/proyecto2
- Compile.
mvn compile
- Run tests.
It is necessary to keep the txt files for the tests to work correctly, which are located in the "proyecto2/testArchivos/" directory.
mvn test
- Installation of the files .jar.
mvn install
Important:
The program makes use of two types of input.
- Run:
java -jar target/proyecto2.jar
to make the program read the standard input.
- Run:
java -jar target/proyecto2.jar [file]
to make the program read a file, where [file] is the directory of that file.
Regardless of the type of input you choose to use (standard or file), the input must follow the following format:
[typeOfStructure] [elements]
Where the types of data structures are:
- ArbolAVL
- ArbolBinarioCompleto
- ArbolBinarioOrdenado
- ArbolRojinegro
- Arreglo
- Cola
- Grafica
- MonticuloMinimo
- Lista
- Pila
And the elements are positive integers, whose range goes from "0 < n < 100", each element must be separated by a space.
Note:
- The progaram ignores line breaks and ignores any string followed by the # character.
- For the Graphic structure an even number of elements is required, since to join edges they are joined in pairs. If you do not want edges, just join them with the same element.
The output of the program is only via standard output, however you can redirect the output to a .svg file with the following command.
java -jar target/proyecto2.jar [fileInput] > [fileOutput].svg
- ArbolRojinegro.
Input
java -jar target/proyecto2.jar testArchivos/ArbolRojinegro/ArbolRojinegro.txt > Output.svg
Where the file "testArchivos/ArbolRojinegro/ArbolRojinegro.txt" contains the following entry:
#Clase
ArbolRojinegro
#elementos
57 19 8 6 15 1 94 99 97
Output
Generates a file named Output.svg which contains the following image:
- ArbolAVL.
Input
java -jar target/proyecto2.jar testArchivos/ArbolAVL/ArbolAVL.txt > Output.svg
Where the file "testArchivos/ArbolAVL/ArbolAVL.txt" contains the following entry:
ArbolAVL 3 26 89 59 75 82 84 53 30 50
Output
Generates a file named Output.svg which contains the following image:
- Lista
java -jar target/proyecto2.jar testArchivos/Lista/Lista.txt > Output.svg
Where the file "testArchivos/ArbolAVL/ArbolAVL.txt" contains the following entry:
Lista 34 24 55 66 0
Output
Generates a file named Output.svg which contains the following image:
- Grafica
java -jar target/proyecto2.jar testArchivos/Grafica/Grafica.txt > Output.svg
Where the file "testArchivos/ArbolAVL/ArbolAVL.txt" contains the following entry:
Grafica
1 2 2 3 3 4 4 5 5 1 1 3 1 4 2 4 2 5 3 5 1 2
Output
Generates a file named Output.svg which contains the following image: