Práctica 4. Pilas y Colas
maxstack.h
Ir a la documentación de este archivo.
1 
7 #ifndef MAXSTACK_H
8 #define MAXSTACK_H
9 
10 #include <queue>
11 #include <utility>
12 using namespace std;
13 
20 template <typename T>
21 class MaxStack {
22 private:
28  queue<pair<T,T>> q;
29 
33  queue<pair<T,T>> aux;
34 public:
35 
40  const pair<T,T>& top() const;
41 
42 
46  void pop();
47 
52  void push(const T& elem);
53 
58  int size() const;
59 
60 
66  bool empty() const;
67 
68 };
69 
70 
71 #endif // MAXSTACK_H
TDA MaxStack.
Definition: maxstack.h:21