Question: / / Bubble Sort Algorithm , order ascendent void sortArray ( int array [ ] , int size ) { bool swap; int temp; do

//Bubble Sort Algorithm , order ascendent
void sortArray(int array[], int size)
{
bool swap;
int temp;
do
{
swap = false;
for (int count =0; count <(size 1); count++)
{
if (array[count]> array[count +1])
{
temp = array[count];
array[count]= array[count +1];
array[count +1]= temp;
swap = true;
}
}
} while (swap);
}
Median Function In statistics, when a set of values is sorted in ascending or descending order, its median is the middle value. If the set contains an even number of values, the median is the mean, or average, of the two middle values. Write a function that accepts as arguments the following:
An array of integers
An integer that indicates the number of elements in the array the function should determine the median of the array. This value should be returned as a double. (Assume the values in the array are already sorted.)
Demonstrate your pointer prowess by using pointer notation instead of array notation in this function.
Modify a BubbleSort Algorithm with a floating-point datatype, descendant order, and pointer notation.
Write a function that returns a pointer floating-point datatype that stores the median of the list of values.
Write a drive program that invokes your functions.
Define all variables dynamically and write the code to deallocate the memory space occupied by them.
5. Shows the output code with the following values:
a.<7.3,1.9,2.4,6.4,3.5,9.3> n =6
b.<7.3,1.9,2.4,6.4,3.5> n =5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!