Share
Explore BrainMass

computer program

Give the pseudo algorithms for the first five approaches. See attached file for full problem description.

Attachments

Solution Preview

a. Exchange Sort
void exchange_sort(apvector <int> &array)
{
int i, j;
int temp; // holding variable
int arrayLength = array.length( );
for (i=0; i< (arrayLength -1); i++)
// to represent element to be compared
{
for(j = (i+1); j < arrayLength; j++)
// to represent the rest of the elements
{
if (array[i] < array[j])
{
temp= array[i]; // swap
array[i] = array[j];
array[j] = temp;
}
}
}
return;
}
b. Insertion Sort
Insertion sort ...

Solution Summary

Give the pseudo algorithms for the first five approaches.

$2.19