Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(JAVA) For an array-based list, which of the following statement best describes the asymptotic analysis according to the code given below on the method of

(JAVA) For an array-based list, which of the following statement best describes the asymptotic analysis according to the code given below on the method of clear()

a.

Both the size of the original list and computing environment affect the time at run, so it is non-deterministic.

b.

The time may varies from each time the program runs, depending on the computing environment, but relevant to the size of the original size of the list

c.

The size of the original list determines the run time taken on the method clear().

image text in transcribed
what more info? that is the question
33 > 21 3 7** Array-based list implementation */9 4 public class AList implements ADTList {! private static final int defaultSize = 10; // Default size private int maxSize; // Maximum size of list private int listSize; // Current # of list items, length private int curr; // Position of current element private E[] listArray; // Array holding list elements /** Constructors */ /** Create a list with the default capacity. */9 public Alist() { this(defaultSize); } /** Create a new list object. @param size Max # of elements list can contain. */ @suppressWarnings ("unchecked") // Generic array allocation 19 public Alist(int size) { maxSize = size; listSize = curr = 0; 22 listArray = ([])new Object[size]; // Create listArray 23 UWPOO OU UN 9 >> 19 11 33 12 33 13 14 53 15 > 16- 17 18 53 29 21 33 53 > >> 24 25 26 27 28 29 /** Reinitialize the list */9 public void clear() { listSize = curr = 0; } // Simply reinitialize values 33

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

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions