Data Structure in C++ Using STL
Not what you're looking for?
Declare a stack, queue, and priority queue of integers, as follows:
stack<int> s;
queue<int> q;
priority_queue<int> pq;
Assume that you input the integer sequence
5 8 12 15 1 3 18 25 18 35 2 55
and insert each value into each container in the order given. What is the output of the following statements?
while (!s.empty())
{
cout << setw(5) << s.top() << setw(5)
<< q.front() << setw(5)
<< pq.top() << endl;
s.pop(); q.pop(); pq.pop();
}
Please provide a complete program if it makes sense.
Purchase this Solution
Solution Summary
A stack, queue, and priority queue of giving integers are declared.
Purchase this Solution
Free BrainMass Quizzes
Basic Computer Terms
We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.
Basic Networking Questions
This quiz consists of some basic networking questions.
C# variables and classes
This quiz contains questions about C# classes and variables.
Javscript Basics
Quiz on basics of javascript programming language.
Basic UNIX commands
Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.