Question: Java:Need to create a timing table that shows how fast an array list of varying size is calculated using the addL method public void addL(Item

Java:Need to create a timing table that shows how fast an array list of varying size is calculated using the addL method

 public void addL(Item x) { if (size == items.length) { resize(size + 1); } items[size] = x; size = size + 1; }

Java:Need to create a timing table that shows how fast an array

N is a number of elements, time is in seconds, # ops depicts how many calls are made to addLast, and microsec gives the amount of seconds it took to call the method. For example, array list of 1000 is computed in 0 seconds, and 64000 elements are computed in 0.01 seconds.

N time (s) #ops microsec/op 1000 2000 4000 8000 16000 32000 64000 128000 0.00 0.00 0.00 0.00 0.00 0.00 0.01 0.01 1000 2000 4000 8000 16000 32000 64000 128000 0.00 0.00 0.00 0.00 0.13 0.13 0.13 0.09 N time (s) #ops microsec/op 1000 2000 4000 8000 16000 32000 64000 128000 0.00 0.00 0.00 0.00 0.00 0.00 0.01 0.01 1000 2000 4000 8000 16000 32000 64000 128000 0.00 0.00 0.00 0.00 0.13 0.13 0.13 0.09

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!