1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alex Ar [27]
4 years ago
10

Consider a smart array that automatically expands on demand. (Like the java.util.ArrayList.) It starts with some given initial c

apacity of 100, and whenever it expands, it adds 50 to the current capacity. So, for example, at the 101st add, it expands to a capacity of 150. How many total units of work would be needed to add 1000 items to this smart array? Assume it takes one unit of work to write an item into an array location, and one unit of work to allocate a new array.
Computers and Technology
1 answer:
elena-14-01-66 [18.8K]4 years ago
4 0

Answer:

Total unit of work required is 1019 units.

Solution:

As per the question:

Initial capacity = 100

On each expansion 50 is added to the present capacity.

Now,

Work done required in addition  of 1000 items = 1000 unit

No. of times there is a need for the allocation of a new Array is given by:

n = \frac{1000 - 100}{50} = 18

We know that:

On addition of 101th element it expands from 100 to 150

On addition of 151st element it expands from 150 to 200 and so on till

On addition of 951st element it expands from 950 to 1000

Now,

For an array of 100 size - 1 for initial allocation.

Therefore, total work done is  given by:

W = 1000 + \frac{1000 - 100}{50} + 1 = 1019\ units

You might be interested in
Which statement about dialogues is NOT correct? Select one: A. Users should be able to control the direction of speed of dialogu
Gennadij [26K]

Answer:

Option B is not correct

Explanation:

Dialogues become problematic when they appear automatically because of high level incompatibility

3 0
3 years ago
A reaction between an acid and a base is both a neutralization reaction and what other kind of reaction?
astraxan [27]
Hi!

The answer is C. Double replacement.

Have a nice day!
7 0
4 years ago
what is the command used to retrieve the java files along with the string existence "Hello world" in it​
Leona [35]

Answer:

java” xargs grep -i "Hello World”

8 0
3 years ago
Given that String[] str has been initialized, to get a copy of str[0] with all characters converted to upper case, use the follo
Strike441 [17]

Answer: str[0].toUpperCase();

Explanation:

str[0] is pointing to the first character of the entire string and the code str[0].toUpperCase() will convert the characters to upper case if they are in lowercase and will remain unchanged if they are already in upper case.

7 0
3 years ago
Examples of ________, which is hosted on a web site, include e-mail, word processing, tax preparation, and game programs.
Keith_Richards [23]

Answer:Web Application

Explanation:Web hosting is more or less like having an ordinary computer in the cloud in order share information and resources with others world wide.One cannot make effective use of a computer without software applications . Similarly hosting just normal html pages and documents on a server cannot help increase productivity,hence the creation of cloud computer applications also known as "Web Apps (Web Applications)" to aid boost productivity and information dissemination via quality task automations.

4 0
2 years ago
Other questions:
  • Over time, programming languages have evolved in phases called ________.
    5·2 answers
  • Sal Kan earned $3,000.00, But he is only getting $1,585.00 on his pay check to
    9·1 answer
  • Which of the following is an example of a direct payment subsidy?
    12·1 answer
  • What type of printer heats toner to adhere it to the paper? inkjet . impact. 3D. laser.
    6·1 answer
  • When planning a presentation, there are several factors you need to consider. Which of the following is one factor you should co
    8·1 answer
  • What's the drawback of using Screened Subnet (DMZ)?
    12·1 answer
  • When an organization uses cloud computing, they do not have to buy and maintain expensive hardware. Group of answer choices True
    6·1 answer
  • A _____ is a valuable tool that enables a user to find information on the Web by specifying words or phrases known as keywords,
    10·2 answers
  • You are a Data Scientist at Anthem Blue Cross Blue Shield. You want to check if a patient will develop diabetes. Please write th
    5·1 answer
  • Jeroo Bob has just awoken from a long night's sleep and is hungry for some winsum flowers. He walks out of
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!