Computers and Technology

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;
}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:20, alcantar28eduin
Print "usernum1 is negative." if usernum1 is less than 0. end with newline. convert usernum2 to 0 if usernum2 is greater than 10. otherwise, print "usernum2 is less than or equal to 10.". end with newline
Answers: 3
image
Computers and Technology, 23.06.2019 06:00, 573589
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, ranmmm
The place where the extended axis of the earth would touch the celestial sphere is called the celestial
Answers: 1
image
Computers and Technology, 24.06.2019 10:20, silviamgarcia
Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should not be added to the list). these values entered by the user are added to a list we call 'initial_list'. then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. finally, inside print out all of the values in the new list. for example: input: enter value to be added to list: a enter value to be added to list: b enter value to be added to list: c enter value to be added to list: exit output: a b c a b c a b c note how 'exit' is not added to the list. also, your program needs to be able to handle any variation of 'exit' such as 'exit', 'exit' etc. and treat them all as 'exit'.
Answers: 2
Do you know the correct answer?
Using the rand () function, fill 5 arrays of integers with the same 10 random numbers. these numbers...

Questions in other subjects: