This is an assignment in Design and Analysis of Algorithms(CS253) course. The objective of the assignment is to compare the performance of various traditional sorting
algorithms taught during the semester and plot graphs for them which showcase their preformance for various cases.
The instructions to run the code the code is as follows.
- Fork of the repository.
- Clone the repository using the HTTPS key.
After cloning the repository navigate to the root directory of the project.
- Run
pip install -r requirements.txt - Each of the 5 sorting algorithms are present in their respective folders.
- Since there is data present in the csv files hence execute
src/python flush.pybefore running the code. - The csv files present for each sorting algorithm contains the input size and the time taken for sorting for all the three types of arrays i.e. increasing array, randomly generated array and decreasing array.
- Execute
src/python test_cases.pyfor generating the csv files. - Navigate to the
Q3folder and run each of theqs_avg_case.py,quick_best_case.pyandquick_worst_case.pyfiles to generate the graphs which compare the performance of quick sort in the 3 different choice of pivots. - Navigate to the
Q4and execute the files in the folder to see the performance of each algorithm vs the other in different cases. - Final_Report.pdf has the answers to all the questions provided in the assignment.
NOTE: After completing the visualisation make sure to run
flush.pyotherwise the programs run into errors.