Ask 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 execute these statements: bag b; b. insert (5); b. insert (4); b. insert (6); b. erase_one (5);

+2
Answers (1)
  1. 29 April, 06:07
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers