Project information

  • Course: Data Structures
  • Project date: Spring 2022
  • Programming Language/Frameworks: C++
  • Project URL: Github

For this project I implemented 5 sorting algorithms: selection sort, merge sort, heap sort, quicksort-fp (first element as pivot point), and quicksort-rp (random element as pivot). These algorithms sort integers in ascending order and keep track of the number of comparisons between two data elements.

In experiment 1, there are three files: ordered, random, and reversed. The ordered file contains integers from 0 to 9999 placed in ascending order. The random file contains 10,000 integers arranged in rnadom order. The reversed file contains integers in the order of 9999 to 0. All five of the algorithm read the values within the files and sort them to determine the number of comparisons.

In experiemnt 2, instead of reading the input from a file, the program will randomly generate integers. The user is prompted to select 10, 100, 500, 1000, 10000, 20000, 50000, or 100000 as the numbers of integers being generated. Afterward, they may select the algorithm of their choosing to sort the integers .

Designed by BootstrapMade