-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStack.h
More file actions
50 lines (38 loc) · 741 Bytes
/
Stack.h
File metadata and controls
50 lines (38 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
Archivo: Pila.h
Autor: Davi T. Montoya
<davidtovarmontoya@gmail.com>
start date: 2020-11-20
last date modified 2021-3-13
Version: 0.1
licence: GPL
*/
#ifndef STACK_H
#define STACK_H
#include "Element.h"
#include<string>
#include<iostream>
#include <typeinfo>
using namespace std;
template<class TIPO>
class Stack
{
private:
int length;
Element<TIPO> *Top;
public:
Stack();
~Stack();
/* return top element */
TIPO top();
/*insert element in the top, does not delete something*/
void push(TIPO item);
/*delete top element and return it*/
TIPO pop();
/*return size of the stack*/
int len();
};
#include"Stack.tpp"
#else
template<class TIPO> class Stack;
#endif