Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need this to be ONE program NOT six different ones using C++ language!! I also

ID: 3554776 • Letter: I

Question

I need this to be ONE program NOT six different ones using C++ language!! I also need the data to print to an output file and run in code blocks. If you have any questions please ask!!

You are given the following input list of numbers to be sorted. Sort the numbers, showing intermediate steps, using the following sort techniques.

LIST, INPUT FROM LEFT TO RIGHT:

      12 8 5 7 13 2 4 14 6 1

Sort using:

Explanation / Answer

#include #include #include void bubblesort(float[],int ); void insertionsort(float[],int); void selectionsort(float[],int); //user defined functions void shellsort(float[],int); void print(float[],int); void read(float[],int); void main() { char wtc='y'; while(wtc=='y'||wtc=='Y') { clrscr(); int choice,n; float a[200]; printf("Enter the size of array"); scanf("%d",&n); printf(" "); printf("Enter %d integers of array",n); read(a,n); printf(" Enter the following numbers to use the following techniques: "); printf(" 1.BUBBLE SORT "); printf(" 2.INSERTION SORT "); printf(" 3.SELECTION SORT "); printf(" 4.SHELL SORT "); printf(" "); printf("Enter your choice"); scanf("%d",&choice); switch(choice) { case 1: { bubblesort(a,n); print(a,n); //calling funtion by using switch statements getch(); break; } case 2: { insertionsort(a,n); print(a,n); getch(); break; } case 3: { selectionsort(a,n); print(a,n); getch(); break; } case 4: { shellsort(a,n); print(a,n); getch(); break; } } coutwtc; } getch(); } void read(float a[],int n) { for(int i=0;i>a[i]; } } void bubblesort(float a[],int n) { for(int p=0;px)//definition of insertion sort a[j--]=a[j-1]; a[j]=x; } } void shellsort(float a[],int n) { int gap; int swap; gap=n/2; int k=0; do{ do{ swap = 0; k++; int i; for(i=0;ia[i+gap]) { int temp; temp=a[i]; a[i]=a[i+gap]; a[i+gap]=temp; swap = 1; } for(int t=0;ta[j]) { float temp; temp=a[i]; a[i]=a[j]; a[j]=temp; } } } void print(float a[],int n) { for(int i=0;i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote