Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this part of an assignment, I dont understand at all... If you need more info ill provide it! These are my

I need help with this part of an assignment, I dont understand at all... If you need more info ill provide it! image text in transcribed

These are my files:

import java.util.Arrays;

public class Runner1 {

private static final String ALPHA_NUMERIC_STRING = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

public static String randomAlphaNumeric(int count) { StringBuilder builder = new StringBuilder(); while (count-- != 0) { int character = (int) (Math.random() * ALPHA_NUMERIC_STRING.length()); builder.append(ALPHA_NUMERIC_STRING.charAt(character)); } return builder.toString(); }

public static String[] CopyArray(String[] source) { return Arrays.copyOf(source, source.length); } public static int random() { int randomNum = (1 + (int) (Math.random() * 7)) + 3; return randomNum; } public static void bubbleSort(String arr[]) { int n=arr.length; for (int i = 0; i 0) { // swap elements String temp = arr[j - 1]; arr[j - 1] = arr[j]; arr[j] = temp; }

} } } public static void selectionSort(String[] arr){ for (int i = 0; i

----------------------------------------------------------------------------------------------------------------

public class Runner2 {

public static void main(String[] args) { int lengths[]= {2000,3000,4000,5000,6000,7000}; long startTime,stopTime,elapsedTime; for(int i=0;i * Write a class named Runner2 that will test the speed of your BubbleSort and SelectionSort methods by recording the time needed to sort an array of different number of Strings (For example, 2000, 3000, 4000, 5000, 6000, and 7000 Strings). Using this data, draw two lines on the same line-plot using MS Excel, one line for Bubble Sort and one for Selection Sort, where x-axis is the number of Strings in the array and y-axis is the runtime. On the MS Word document, (1) copy the plot and paste it, (2) report the configuration (processor speed and model, memory, and operating system) of the computer where vou executed Runner2, (3) write what are the time complexities of Bubble sort and Selection sort algorithms, (4) write no more than four sentences on if (and how) your plot demonstrates the expected time complexities of Bubble sort and Selection sort algorithms. Submit the MS Word file with your source codes Convert/Export your MS Word file to a PDF file and submit it with all other files Deliverables:Runnerl.java, Runner2.java, MyPlot.docx, and MyPlot.pdf

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sybase Database Administrators Handbook

Authors: Brian Hitchcock

1st Edition

0133574776, 978-0133574777

More Books

Students also viewed these Databases questions

Question

LO1 Identify why performance management is necessary.

Answered: 1 week ago