Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stack<int> s;
- s.size();
- s.empty();
- s.push(x);
- s.top();
- s.pop();
- queue<int> q;
- q.size();
- q.empty();
- q.push(x);
- q.front();
- q.pop();
- deque<int> q;
- q.size();
- q.empty();
- int x;
- q.push_back(x);
- q.pop_back();
- q.back();
- q.push_front(x);
- q.pop_front();
- q.front();
- priority_queue<int> q;
- q.size();
- q.empty();
- int x;
- q.push(x);
- q.top(); // max element in pq
- q.pop(); // delete max
- priority_queue<int , vector<int> , greater<int> > q;
- q.size();
- q.empty();
- int x;
- q.push(x);
- q.top(); // min element in pq
- q.pop(); // delete min
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement