/Sorting_Algorithms

This repository aims to combine all(eventually) sorting algorithms into one piece of code as a quick refresh for beginners and experts. It also measure the time taken by each sorting algorithm function.

Primary LanguageC++MIT LicenseMIT

Sorting_Algorithms

This repository aims to combine all (eventually) sorting algorithms into one piece of code as a quick refresher for beginners and experts. It also measures the time taken by each sorting algorithm function.

To begin with, the following sorting algorithms have already been added, and more can be added.

  1. Selection Sort - (Average: O(n2), Worst: Average: O(n2))
  2. Insertion Sort - (Average: O(n2), Worst: Average: O(n2))
  3. Bubble Sort - (Average: O(n2), Worst: Average: O(n2))
  4. Quick Sort - (Average: O(nlogn), Worst: Average: O(n2))
    • Paritions array into two based off of a pivot index. One holds values less than pivot, the other holds values higher than pivot. Then recursively sorts the two arrays.
    • https://youtu.be/kPRA0W1kECg?t=40

How to Build/Run?

On Linux/Mac, use g++ sortOfAllSort.cpp -o sortOfAllSort && .\sortOfAllSort On Windows, use Visual Studio to run the file. Alternatively, install g++ and use the above command.