-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyStack.cpp
More file actions
65 lines (52 loc) · 1.26 KB
/
myStack.cpp
File metadata and controls
65 lines (52 loc) · 1.26 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <iostream>
#include "myStack.h"
using namespace std;
/*
* Constructor
* Usage: myStack(maxSz);
* -------------------------
* A new stack variable is initialized. The initialized
* stack is made empty. maxSz is used to determine the
* maximum number of character that can be held in the
* stack.
*/
myStack::myStack(int maxSz) {
// TODO
}
/* Destructor
* Usage: delete ptr
* -----------------------
* This frees all memory associated with the stack.
*/
myStack::~myStack() {
// TODO
}
/*
* Functions: push, pop
* Usage: s1.push(element); element = s1.pop();
* --------------------------------------------
* These are the fundamental stack operations that add an element to
* the top of the stack and remove an element from the top of the stack.
* A call to pop on an empty stack or to push on a full stack
* is an error. Make use of isEmpty()/isFull() (see below)
* to avoid these errors.
*/
void myStack::push(int element) {
// TODO
}
int myStack::pop() {
// TODO
}
/*
* Functions: isEmpty, isFull
* Usage: if (s1.isEmpty()) ...
* -----------------------------------
* These return a true value if the stack is empty
* or full (respectively).
*/
bool myStack::isEmpty() const {
// TODO
}
bool myStack::isFull() const {
// TODO
}