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

If you toss three coins, what are the odds in favor of getting exactly two tails and one head? A)3:8 B)3:5 C)5:3 D)8:3
How does the sky change as one gets above earth's atmosphere?
In a bowl, there are 3 peaches, 2 apples, 6 lemons, and 4 plums. If 1 piece of fruit is to be selected at random, what is the probability it will be a lemon?
Do you agree that romeo and juliet, pyramus and thisbe, and a midsummer night's dream are all examples of ill-fated love or love that is doomed for disaster
Latent heat: a. has only small effects on the atmosphere. b. is the same for all substances undergoing the same phase change. c. is more important for the atmos
how do I find the area and perimeter for this
Suppose you were given carbon tetrachloride to use as a solvent. you could use it to dissolve which of these compounds? a. all of the compounds
What’s 2 euros in dollars?
Please help :) 30 points
Help I don’t know this