Question: I have my coding for my final assignment almost complete. I ' m running into 4 errors that I cannot wrap my head around. Sorting
I have my coding for my final assignment almost complete. Im running into errors that I cannot wrap my head around. Sorting has been a nightmare for me Could you take a look at my header coding and implementation coding below, as well as my driver file SS I would love to figure out how to fix these errors and run this code. #ifndef SORTINGALGORITHMH
#define SORTINGALGORITHMH
#include
#include
class Sort
public:
void bubbleSortstd::vector& arr;
void quickSortstd::vector& arr, int low, int high;
int partitionstd::vector& arr, int low, int high;
void printArrayconst std::vector& arr;
;
#endif #include "sortingalgorithm.h
void Sort::bubbleSortstd::vector& arr
int n arr.size;
for int i ; i n ; i
for int j ; j n i ; j
if arrj arrj
std::swaparrj arrj ;
int Sort::partitionstd::vector& arr, int low, int high
int pivot arrhigh;
int i low ;
for int j low; j high; j
if arrj pivot
i;
std::swaparri arrj;
std::swaparri arrhigh;
return i ;
void Sort::quickSortstd::vector& arr, int low, int high
if low high
int pi partitionarr low, high;
quickSortarr low, pi ;
quickSortarr pi high;
void Sort::printArrayconst std::vector& arr
for int num : arr
std::cout num ;
std::cout std::endl;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
