subject

Using the rand () function, fill 5 arrays of integers with the same 10 random numbers. these numbers should be values between 1-100. the arrays should hold 10 integers and named; bubblearray, selectionarray, insertionarray, quickarray, and mergearray.

2. you should use the: a. bubble sort function to sort the bubblearray b. selection sort function to sort the selectionarray c. insertion sort function to sort the insertionarray d. quick sort function to sort the quickarray e. merge sort to sort the mergearray each unsorted array should be outputted to a file name assignment2results followed by the sorted version of the array and the time taken to sort the array to the same file.

using c++

how do i edit below to fit the requirements mentioned atop?

current code:

#include
#include
#include
#include

using namespace std;

int main()
{
int i, j, n=10, temp;
int bubblearray [n];
int selectionarray [n];
int insertionarray [n];
int quickarray [n];
int mergearray [n];
srand (time(null));

for (i = 0; i < 10; i++)
{
int value = rand() % 100 + 1; // random from 1 through 100
bubblearray [i] = value;
selectionarray [i] = value;
insertionarray [i] = value;
quickarray [i] = value;
mergearray [i] = value;

cout < < "this is the randomly generated list for bubblearray: ";
cout < < bubblearray[i] < < " ";

}

cout < < "\n";
cout < < "\nthis is the list after being sorted by the bubble sort method: ";

i = 0, j = 0;

system("pause");
return 0;
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:30
Agood flowchart alludes to both the inputs and outputs you will need to receive and give to the user. true or false?
Answers: 3
question
Computers and Technology, 22.06.2019 06:30
Exchanging which type of data uses the least bandwidth? music photographs video voice bandwidth- the amount of data that can be moved between two points in a set time period
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Complete the sentence about a presentation delivery method
Answers: 2
question
Computers and Technology, 23.06.2019 07:50
Most shops require the technician to enter a starting and ending time on the repair order to track the actual time the vehicle was in the shop and closed out by the office. this time is referred to as _ time ? a. comeback b. ro c. cycle d. lead
Answers: 1
You know the right answer?
Using the rand () function, fill 5 arrays of integers with the same 10 random numbers. these numbers...
Questions
question
History, 07.05.2021 21:00
question
Mathematics, 07.05.2021 21:00
question
Mathematics, 07.05.2021 21:00
question
History, 07.05.2021 21:00
question
English, 07.05.2021 21:00
question
Mathematics, 07.05.2021 21:00
question
Mathematics, 07.05.2021 21:00