Create a virtual environment for Python 3.12 and download the python packages using the command.
pip install requirements.txt
Setup GoLand from Jetbrains or any other IDE.
Run the command below to generate the input files.
python generate_input.py
Set the working directory of the IDE to be the src directory and program arguments to be one of the following:
- -a for both uniform and move-to-front distribution
- -u for uniform distribution
- -m for move-to-front distribution
Run the main.go file from the main module to create the output. The output files are space delimited with three columns. The first, second and third columns are the tree size, splay tree runtime and Van Emde Boas tree runtime respectively. Go into the benchmark directory.
cd src/benchmark
Run the python script plot.py with a specified output file to plot it. An example command is given below.
python plot.py ../output/mtf_opt_medium.out
The plot.py script also contains a scipy t-test function. To run it, simply call the stat_test function in the plot function with the runtime arrays for Van Emde Boas and Splay trees along with the specified significance value.