-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.h
More file actions
46 lines (35 loc) · 960 Bytes
/
stack.h
File metadata and controls
46 lines (35 loc) · 960 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
//
// stack.h
// artunsarioglu_cs300_hw1
//
// Created by Artun on 10.07.2019.
// Copyright © 2019 Artun. All rights reserved.
//
#ifndef stack_h
#define stack_h
#include <vector>
using namespace std;
// this always will be integer therefore I dont necessarily need to implement template class here but I will do it for whatsoever reason
template<class T>
struct coordinate {
int xCor; // x-axis of coordinate
int yCor; // y-oordinate of coordinate
//any initial coordinate will be 0,0
};
template <class T>
class Stack {
private:
//T top; // in our case it is integer
vector<coordinate<T>> stack_array;
T topOfStack;
// Put your internal data representation here
public:
Stack(); //default constructor , contains nothing
void push(coordinate<T> coor);
void pop();
coordinate<T> top();
bool isEmpty();
const static T noItem;
};
//#include "stack.cpp"
#endif /* stack_h */