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 21:00
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings starting from index 0. for each match, add one point to userscore. upon a mismatch, exit the loop using a break statement. assume simonpattern and userpattern are always the same length. ex: the following patterns yield a userscore of 4: simonpattern: rrgbryybgy userpattern: rrgbbrybgy
Answers: 2
question
Computers and Technology, 23.06.2019 10:00
Now, open this passage to read about fafsa requirements. describe the information you will need to provide in order to complete a fafsa. list at least three of the required documents you must include.
Answers: 3
question
Computers and Technology, 24.06.2019 05:30
How do i get rid of my member ship for
Answers: 2
question
Computers and Technology, 24.06.2019 06:30
Me and category do i put them in because this is science
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
Business, 15.07.2019 08:00
question
Mathematics, 15.07.2019 08:00
Questions on the website: 13722363