Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Instructions : Run the PerformanceTest on your computer and compare it with the data from the PerformanceTest provided. Answer the questions below in the

JAVA

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Instructions : Run the PerformanceTest on your computer and compare it with the data from the PerformanceTest provided. Answer the questions below in the EXCEL spreadsheet. Make sure to save the original so that you can compare it to your test run. Also, answer the questions below in a document and convert both the EXCEL file and the Text document into one PDF Document and Submit. Failure to submit ONLY ONE pdf document on Canvas results in an automatic 20% deduction. Questions/Analysis Instructions : Answer the questions after running the PerformanceTest program. 1. How similar or different is the performance of the data shown in the EXCEL file compared to your results? 2. What do observe for each of the algorithms shown with their corresponding data set? 3. Can you tell which algorithm was the most efficient? 4. For algorithms 1 and 2 , did reducing the amount of computations by half improve the runtime significantly? Explain your reasoning, if you felt it had a small or large change. 5. For algorithms 2 and 3 , did reducing the number of loops improve the runtime significantly? Explain your reasoning, if you felt it had a small or large change. Finding the "Range" of a List of Integers The range is the difference between the highest and lowest numbers in the array. Algorithm 1 : Range1 Description: This algorithm uses nested loops to examine every pair of elements in the array , computing their difference and remembering the largest difference found. maxDiff=0; for (each index i ) for (each index j ) update maxDiff, if elements i and j differ more than max. Algorithm 2 : Range2 Description: This algorithm reduces the amount of computations performed by disregarding one of the (i, j) and (j, i) pairs, that give identical comparisons. It still uses nested loops to examine every pair of elements in the array but now only once, computes their difference and remembering the largest difference found. maxDiff=0; for (each index i ) for (each index j=i+1 ) update maxDiff, if elements i and j differ more than max. Algorithm 3 : Range3 Description: This algorithm uses a loop to find the largest value and smallest value in the array, compute their difference and return this difference. max= element [0] min=max for (each index i) find max. find min. return max - min Where to find data in my-work folder > data > Range_RunTimes.xlsx Where to find starter code in my-work package.class : week04\$algoanalysis.PerformanceTest Task List 1. Run the PerformanceTest program and run the data sets listed for each of the range algorithms on your computer. Write a short summary (4-5 sentences is enough) of your observations when running program for the three (3) algorithms. 2. Modify the Range_RunTimes EXCEL file to also include your data and compare it with the previous data. 3. If you are experiencing an OutOfMemoryError : Java heap space for your PerformanceTest program. This is possibly due to your Java Virtual Machine (JVM) needing more memory to run this application. You can change your VM Java, the Xms and XXm flags are used to set the initial and maximum size of the Heap memory. 4. To change VM options in INTELLIJ, GOTO> Run->Edit Configurations->Modify Options->Add VM Options and add Xm3800m or Xm4800m. In IntelliJ, you only need to set the max heap memory size to get things working but you can also use -Xms512s Xm4800m depending on set up. If you still have issues increase max heap memory to Xm6400m or greater value. If your computer is say over say 10 years old, there may be no hope for you, since your memory will be definitely maxed out long before this! 5. You can also GOTO> Settings > 'Edit Custom VM Options' and update to VM options Xm2048 to something larger e.g. - Xmx4800 etc. ct PerformanceTest.java

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

3. Is there opportunity to improve current circumstances? How so?

Answered: 1 week ago

Question

2. How will you handle the situation?

Answered: 1 week ago