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 institutionalized is Brazil Protestantism
Suppose a nation has a great deal of human capital but few natural resources. in what kinds of products might it specialize?
What is 12 3/4 2 1/2
How to do proportions?
factor Completely : x^2+8x-16
I really need a really good "summary writing" OF ANY BOOK I DO NOT INTEREST!! It must have: - Topic sentence - Supporting Details - Grammar, Spelling and Punct
At the grocery store, you buy a carton of milk for $1.95, a loaf of bread for $0.85, and a box of cereal for $2.05. Use mental math to find the total cost of t
I need help finding out what x is only using the sine and cosine rule.
How did the manufacture of textiles change after 1760?
How does a substitution mutation affect a cell?