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

The length of a bridge is 150 m. The length of each of Robert's paces is 65 cm. What is the minimum number of roll paces that it would take Robert to walk the f
Cho hai điện tích q1 = 2.10-6 C, q2 = 4. 10-6C, đặt tại A và B trong không khí biết AB = 2 cm. Xác định vectơ cường độ điện trường tại: a) H, là trung điểm của
The record low temperature in Houston for November 12th is -3 degrees. The record high temperature is 83 degrees. What is the difference between the record high
PLS HELP I'LL DIRECTLY MARK YOU BRAINLIST!!!
Where does Jesus live
CAN YOU PLS CHECK IF ITS CORRECT I'LL MARK YOU BRAINLIST
use implicit differentation to determine dy/dx for the equation
What were the general beliefs in the United States in the 19th century, when women became more involved in social reform? Answer “true” or “false” Women were li
522 to base two (i'm struggling so bad with math :,))
What’s the answer to this