19 lines
304 B
C++
19 lines
304 B
C++
|
|
#ifndef EXAMPLE28_STACK_H
|
|
#define EXAMPLE28_STACK_H
|
|
#include "List.h"
|
|
|
|
class Stack : private List {
|
|
public:
|
|
Stack() : List() {
|
|
}
|
|
void push(int x) {
|
|
insertAtBeginning(x);
|
|
}
|
|
int pop() {
|
|
return deleteAtBeginning();
|
|
}
|
|
};
|
|
|
|
#endif //EXAMPLE28_STACK_H
|