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

How did machines speed up  textile manufacturing
Can water and pebbles form a solution?
Why did the Virginia Company give settlers the right to self-government?
How did machines speed up  textile manufacturing
You work at a clothing store, and your boss wants you to find out which type of shirt had the highest percentage of sales. You found that 13 out of 20 tank tops
How did machines speed up  textile manufacturing
do you know 3 prime numbers that equal 32
how do you can you solve this problem 37 + y = 87; y =
rewrite the expression without using grouping symbols. -6(8+12)
Jamaal buys his clothes at Super Discounts. On Saturday, he bought shoes regularly priced at $40 for 25% off, and a jacket regularly priced at $100 for 30% off.