
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Trace the following code segments and show the output. // list
for (int j = 0; j <= 5; j++) numbers.insert(numbers.begin(), j);
list
deque
for (int i = 0; i < deqTest.size(); i++) cout << deqTest[i] << ' ';
cout << endl;
// priority_queue
pq.empty(); pq.push(1); pq.push(9); pq.push(2);
while (!pq.empty()) { cout << pq.top() << " "; pq.pop(); }
priority_queue
while (!pq1.empty()) { cout << pq1.top() << " "; pq1.pop(); }