Ask Question
29 September, 06:27

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);

+5
Answers (1)
  1. 29 September, 10:10
    0
    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;
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “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 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers