40 lines
553 B
C++
40 lines
553 B
C++
//
|
|
// Created by eduardo on 9/11/19.
|
|
//
|
|
|
|
#ifndef COLAS_FILAS_PILA_H
|
|
#define COLAS_FILAS_PILA_H
|
|
|
|
|
|
class Pila {
|
|
private:
|
|
typedef struct node{
|
|
int data;
|
|
node* next;
|
|
}* nodePtr;
|
|
nodePtr top;
|
|
nodePtr current;
|
|
nodePtr temp;
|
|
public:
|
|
Pila();
|
|
void insert(int info);
|
|
nodePtr take();
|
|
void remove();
|
|
virtual ~Pila();
|
|
|
|
const node *getTop() const;
|
|
|
|
void setTop(const node *top);
|
|
|
|
const node *getCurrent() const;
|
|
|
|
void setCurrent(const node *current);
|
|
|
|
const node *getTemp() const;
|
|
|
|
void setTemp(const node *temp);
|
|
};
|
|
|
|
|
|
#endif //COLAS_FILAS_PILA_H
|