Create a void function called display with 2 parameters: the array to be displayed and size and use a dynamic array of type int and complete the main program. CODE: #include using namespace std; void...


Create a void function called display with 2 parameters: the array to be displayed and size and use a dynamic array of type int and complete the main program.


CODE:


#include
using namespace std;


void bubleSort(int *a, int n);
void display(int *a, int n);


int main()
 {
   // your declarations here...
   cout < "enter="" number="" of="" elements="" to="" be="" sorted:="">
   //accept inputs...

   cout < "enter="" the="" values="" ...="">

   bubleSort(num, size);
 }




void bubleSort(int *a, int n)
{
    int last = n - 1;
    cout < "\nbubble="" sort..."="">< endl=""><>
    for (int i = 0; i < last;="">
    {
        for (int j = last; j > i; j--)
            if (a[j - 1] > a[j])
              swap(a[j], a[j - 1]);
        cout < "pass="" "="">< i="" +="" 1="">< "...."=""><>
        display(a, n);
        cout <>
    }
}


void display(int *a, int n)
{

}



Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here