sorting-algorithms-analysis

Part 1 : Implementation of two types of sorting algorithms whose complexity is O(n^2) :

  • Selection sort
  • Insertion sort

And another two types of sorting algorithms whose complexity is O(nlgn)

  • Merge sort
  • Quick sort

Then passing 4 random arrays of different sizes (1000,25000,50000,100000) each array is passed 4 times to the 4 sorting functions. Using matplot library in python to plot the array sizes on x-axis versus the running time of the sorting functions on y-axis to observe the difference in performance between the 4 functions

Part 2 :

  • Implementation of hybrid sorting algorithm that apply merge sort till reaching a threshold value .then , the program sorts the subarray by selection sort.
  • Finding kth smallest element in certain array using partition function.

credits to Ali Mekky, Seif Tahtawy and Moahmed Alaa