Skip to content

VladP812/sorting_algorithms

Repository files navigation

Collection of sorting algorithms implemented in Python

How to debug (PyCharm):

  • Clone repository
  • Create a new project in PyCharm pointing to root direcory of cloned repository
  • Open run.py file
  • With run.py file opened press CONTROL+SHIFT+F10 - this will automatically add a configuration so you can easily run the file
  • Place breakpoints
  • Press debug button to run the file in the debug mode (button with a bug icon next to the play (run) button)
  • Follow detailed instructions in the run.py file

How to run performance comparisons:

  • Clone the repository
  • Run pip install -r requirements.txt (better do it in a new virtual environment)
  • Run python performance_comparisons.py
  • After it completed, you will see two files created in the measurments directory, where .json file is a json representation of the performance measurments, and the .jpeg file is the actual chart you can open with an image viewer.

How to add/remove algorithms:

! This is temporary, not very convenient method, it will be changed in the future

  • In the performance_comparisons.py file there is a list containing functions (algorithms) to be measured:
  if __name__ == "__main__":
    algorithms: list[Callable] = [quick_sort, insertion_sort]
  • To add or remove algorithms you want to measure, simply delete/append a function from/to this list.

Optional:

  • If you are running the script within an IDE, you can uncomment plot.show() in the main method so that the plotted chart will be shown automatically.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages