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

What is NOT something the Shang king would have control over?
True or False: There are more Spanish speakers in the United States than in the country of Spain where the language originated.
What is a bicameral legislature_________________________________ Congress has two chambers and each chamber is known as _________________and _________________
A student measured a plant’s growth when given various amounts of water. Which type of data was collected by the student?
How might one go about becoming an art critic? A. Be aggressive and try to get published wherever you can B. Work for important museums and galleries C. Become
iles Excessive business and consumer demand can cause demand-pull inflation.?
How to say, "Alejandro will climb mountains." in Spanish?
1 Draw the Venn diagram below. Write the numbers 8, 9, 10, 11, 12 and 13 in the correct places on your Venn diagram. multiples of 2 13 8 multiples of 6​
Three blocks are shown: Block A has mass 2 kilograms, length 5 centimeters, height 2 centimeters, and width 1 centimeter. Block B has mass 2 kilograms, length 1
Which number represents the phase change from solid to liquid?