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

Écriture Suivez ces indications pour écrire une composition. Écrivez un paragraphe dans lequel vous: parlez de la dernière fois que vous avez préparé un dîner,
5. Tech A says that shock absorbers can be tested with a "bounce test." Tech says than is industry standard to replace an individual faulty shock absorber. Who
All of the following impacted the origin of capitalism after the ending of feudalism except the A. Age of Exploration B. Protestant Reformation C. Enlightenment
Paul bought 4 DVDs for $9.95 each. What was his total cost? A.$39.90 B.$40.80 C.$39.80 D.$38.80
2(3x+2)=6x+4 linear equations
How do sections one through twenty two differ from the remaining sections of the passage? A) The second half of the passage marks a shift in the attitude of El
Evaluate −6a^3+8a^2+8a+1, when a=5.
A circle has an area between 100-150 square inches,what are some possible lengths for a diameter of this circle
Why do some animals migrate in and out of the coniferous forest?.
What is observational learning? a reinforcement for behavior that is consistent with an authority figure’s beliefs b acquiring attitudes through watching othe