consolidate all repos to one for archive
This commit is contained in:
19
semester_2/programiranje_2/primeri/Example01c/Stack01c.cpp
Normal file
19
semester_2/programiranje_2/primeri/Example01c/Stack01c.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "Stack01c.h"
|
||||
#define EMPTY (-1)
|
||||
|
||||
Stack::Stack() {
|
||||
top=EMPTY;
|
||||
}
|
||||
|
||||
void Stack::push(int n) {
|
||||
arr[++top] = n;
|
||||
}
|
||||
|
||||
int Stack::pop() {
|
||||
return arr[top--];
|
||||
}
|
||||
|
||||
int Stack::isEmpty() {
|
||||
return top == EMPTY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user