Ask Question
1 June, 02:20

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

+4
Answers (1)
  1. 1 June, 04:43
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers