Write a computer program that prompts the user for a number, creates.docx - Write a computer program that prompts the user for a number creates an array

Write a computer program that prompts the user for a number, creates.docx

This preview shows page 1 - 3 out of 3 pages.

Write a computer program that prompts the user for a number, creates an array for that number of random integers, and then uses the sophisticated form of bubble sort to order the array. The program should print out the array prior to the call to the sorting algorithm and afterwards. You can write the program in either Java, C++, C#, or whatever language you are most comfortable in. Repeat 1 but use insertion sort this time. 1 and 2 are primarily intended to make sure that your algorithms work. Once you are convinced your programs work, do the following Write a computer program that prompts the user for two numbers, n for the number of items in the array to sort, and num_ifor a number of iterations. Then do the following: Initiate a variable running_time to 0 Create a for loop that iterates num_i times. In the body of the loop, Create an array of n random integers Get the time and set this to start-time. You will have to figure out what the appropriate command is in the programming language you are using to find them time

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture