Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help of how to include the merge sort code into this counter code found below: #include using namespace std; int bubble_counter=0,selection_counter=0; // variables

I need help of how to include the merge sort code into this counter code found below:

#include using namespace std; int bubble_counter=0,selection_counter=0; // variables global

void bubble_sort(int [], int); void show_array(int [],int); void selectionsort(int [], int );

int main() { int a[7]={4,1,7,2,9,0,3}; show_array(a,7); //bubble_sort(a,7); selectionsort(a,7); show_array(a,7); cout<<"Bubble counter = "<array[count +1]) { temp =array[count]; array[count]=array[count +1]; array[count +1]= temp; swap = true; } } }while(swap); } void selectionsort(int array [], int size) { int startscan, minindex, minivalue; for (startscan = 0; startscan < (size - 1); startscan++) { minindex = startscan; minivalue = array[startscan]; for(int index = startscan + 1; index < size; index++) { selection_counter++; if (array[index]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How flying airoplane?

Answered: 1 week ago