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

Please help! Learning about rates and proportional relationships. (attachment included)
It is easier to hack into a computer using a wireless connection. True False
Kylie used 10 cups of raisains to make 5 batches of oatmeal cookies how many cups of raisains are in 1 batch of cokies
Assuming force is constant, how does the mass of an object affect its acceleration?
if you were president what would you do to make the world better
What were some of the problems faced by Latinos in the late 1960s and early 1970s?
****Please help me with this math problem!!**** Will give stars, thanks, and brainliest!! Josh solved the equation below. Is his solution correct? Explain why o
Communicating clearly in an email can sometimes be difficult because ______________. email is supposed to be short email has to stay on topic email
what happened to california as a result of the compromise of 1850
At the honda dealership,45% of all cars sold include a sunroof. If this sold 247 cars last week, about how many would you expect to have included a sunroof?