clarissaalvarad3496 clarissaalvarad3496
  • 10-03-2020
  • Computers and Technology
contestada

Suppose that the bag class is efficiently implemented with a fixed array with a capacity of 4000, as in Chapter 3 of the class text. We execute these statements: bag b; b.insert(5); b.insert(4); b.insert(6); b.erase_one(5);

Respuesta :

akindeleot
akindeleot akindeleot
  • 10-03-2020

Answer:

b.used is 2, b.data[0] is 4, b.data[1] is 6

Explanation:

bag b;

b.insert(5); // b has 5

b.insert(4); // b has 5,4

b.insert(6); // b has 5,4,6

b.erase_one(5); // now 5 is removed , b has 4,6

so no:of elements b.used is 2

b[0]=4;

b[1]=6;

Answer Link

Otras preguntas

10. Which mineral has the smallest daily requirement? 7 pome) oiron calcium phosphorus O magnesium
Help me answer the rest please
In a popular casino​ game, you can bet one whether a ball will fall in an arc on a wheel colored​ red, black, or green. Say the probability of a red outcome is
Which of the following lines is perpendicular to the equation given below? y=−2x+8 A. 2x−y=12 B.x−2y=6x C.x+2y=8x D.2x+y=4
Explain.Car side mirrors do not work when they are convered with frost. What does frost do no the surface of a mirror to cause a diffuse reflection?​
) How many milliliters are equal to 4 liters? 1) 400 milliliters ) 40.000 40 milliliters 4.000 milliliters milliliters
Identify the zeros of the function graphed below
Write 2y = (5/4)x - 2 in a standard form where A, B, and C are integers whose greatest common factor is 1.
Someone help me with this ASAP!!!
a recipe calls for 3\10 cup of sugar for every 5 cups of water how many cups of sugar are needed for 25 cups of water