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
Implementing HTML best practices and writing code to match the original intentions of each element is known as __________ HTML.
erica [24]

Answer:

semantic

Explanation:

The description provided is describing the practice known as semantic HTML. This is basically code that provides both the user and the developer a description on what the code was originally supposed to do. For example, a method that calculates the total cost of a set of prices could be called calculateTotal(). By doing so you are describing the intention of the method clearly so that the individual using the method does not need to look at anything else to know what it does.

6 0
3 years ago
What is what is a network that is easy to maintain and cheap ​
kifflom [539]

Answer:

Click at the pic above and the ans will appear.

Hope it helps :)

4 0
3 years ago
Write a class named Add that has the following data members, constructor, and methods:
taurus [48]

Answer:

A class is like a blueprint of object.

Explanation:

A class defines the kinds of data and the functionality their objects will have.

A class enables you to create your own custom types by grouping together variables of other types, methods and events.

In C#, we can create a class  using the class keyword.

Here's a sample program:

using System;

namespace ConsoleApplication

{

   public class Test

   {

       public static void Main()

       {

           Add a1 = new Add(70, 50);

           a1.AddNumbers();                    

           Console.ReadLine();

       }      

   }

     class Add

   {

       private int row;

       private int column;

       public Add(int r, int c)

       {

           row = r;

           column = c;

       }

       public void AddNumbers()

       {

           Console.WriteLine(row+column);

       }

   }

}

output: 120

Explanation of the program:

I have created a class named Add. Within a class, row and column are two fields and AddNumbers() is a method. We also have constructor to initialize row and column.

In main method, If I need to invoke members of the class, I must create  an instance of the class. We can create any number of instances using the single class.IN our program, a1 is the reference variable using which we can invoke members of the class. I invoked function in the class and passed arguments to the constructor while creating an instance.

Those values are assigned to method variables and it operated the addition. Thus the output is 120.

7 0
3 years ago
Laptop computers, personal digital assistants, and cellular phones were all readily accepted and diffused in U.S. markets where
astra-53 [7]

Answer: Compatibility

Explanation:

 According to the question, the given products are offering compatibility with the customers needs and the priorities of the consumers. The customers comparability means the degree of the product that fit between customers expectation and the capability of serving by the operation team.

The customers expectation mainly reflected both the present and the past evaluation of the products and the user experience. The compatibility of the customers needs is to meet the quality, value  and the service of the product.

8 0
3 years ago
Need help !!!!!!!!!!!!!!!
Paladinen [302]

# 2 on the right goes to zipties

3 0
4 years ago
Other questions:
  • In the dental industry, light-activated adhesives have been used for decades to help adhere braces to teeth as well as being use
    6·2 answers
  • What is the best web browser to use?
    9·2 answers
  • How do i stream from my chromebook to my tv?
    8·1 answer
  • What piece of software tells the operating system how to use a specific hardware device?
    14·1 answer
  • When there is flooding and you see pooled water, what should you do?
    13·1 answer
  • A company is deploying a file-sharing protocol across a network and needs to select a protocol for authenticating clients. Manag
    13·1 answer
  • List three examples of telescopes that detect different types of electromagnetic radiation?
    11·1 answer
  • Which are emotional effects of anxiety? Check all that apply.
    10·2 answers
  • Ebay employs the _____ auction mechanism.
    8·2 answers
  • What does l m a o actually mean?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!