Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/ / 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

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

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

=+46. Monthly gas prices, part 3. Using the data from Exercise

Answered: 1 week ago

Question

Why is interest in portable benefits in health care increasing?

Answered: 1 week ago