Skip to content

This C++ program implements QuickSort to sort an array of integers from a file. The user specifies the pivot position (first, middle, or last). It outputs the sorted array, the number of comparisons, and the total number of elements. This program demonstrates QuickSort's efficiency and the impact of different pivot selection strategies.

Notifications You must be signed in to change notification settings

barahaw/QuickSort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

QuickSort Program

This program sorts an array of integers using the QuickSort algorithm and allows the user to select the position of the pivot element (first, middle, or last). The program also counts the number of comparisons made during the sorting process.

Features

  • Reads input from a file specified by the user.
  • Allows the user to select the pivot position (first, middle, or last).
  • Outputs the sorted array.
  • Displays the number of comparisons made during the sorting process.
  • Displays the number of elements in the array.

How to Use

  1. Compile the program using a C++ compiler: `�ash g++ quicksort.cpp -o quicksort

About

This C++ program implements QuickSort to sort an array of integers from a file. The user specifies the pivot position (first, middle, or last). It outputs the sorted array, the number of comparisons, and the total number of elements. This program demonstrates QuickSort's efficiency and the impact of different pivot selection strategies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages