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

(−2x0y3 )(4x2y4 )+(2y5 )(3xy)2
add and simplify  9/16=1/2=?
vesicles that contain a cells digestive enzymes are called ?
Alex built a snowman using three snowballs,one small, one medium and one large, with diameters in the ratio 2:3:5.      Although highly unlikely due to the phys
vesicles that contain a cells digestive enzymes are called ?
log3(2x-5)=2 Answer is 41/2.  Why?
add and simplify  9/16=1/2=?
log3(2x-5)=2 Answer is 41/2.  Why?
log3(2x-5)=2 Answer is 41/2.  Why?
log3(2x-5)=2 Answer is 41/2.  Why?