- Clone the repo
git clone https://github.com/TheArcus02/AiSD-assignments.git
- Install python packages
pip install -r requirements.txt
Set the constant variables in main.py file.
- MAX_LEN - Lenght of data array will contain
- STEP - Number of data sets to be messured
- ALGORITHM - Sorting algorithm used for setTimesComplexity function
- DATA_TYPE - Data type used for compareAlgorithms function
from merge import merge_sort
def main():
# constants
MAX_LEN = 50000
STEP = MAX_LEN // 15
ALGORITHM = merge_sort
DATA_TYPE = 'ascending'
...
Uncoment one of the following functions. To either generate plot for one algorithm but all data types or to generate plot for one data type but all algorithms.
setTimesComplexity(MAX_LEN, STEP, ALGORITHM)
compareAlgorithms(MAX_LEN, STEP, DATA_TYPE, [
insertion_sort, selection_sort, heap_sort, merge_sort])
To run the script:
cd sorting
py main.py
Set the constant variables in main.py file.
- MAX_LEN - Lenght of data array will contain (Be aware of quicksort high space complexity)
- STEP - Number of data sets to be messured
def main():
# constants
MAX_LEN = 4500
STEP = MAX_LEN // 15
...
To run the script:
cd quicksort
py main.py
Distributed under the MIT License.