summaryrefslogtreecommitdiff
path: root/algo1w4d1/Stack.h
diff options
context:
space:
mode:
Diffstat (limited to 'algo1w4d1/Stack.h')
-rw-r--r--algo1w4d1/Stack.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/algo1w4d1/Stack.h b/algo1w4d1/Stack.h
new file mode 100644
index 0000000..a842bba
--- /dev/null
+++ b/algo1w4d1/Stack.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+class Stack {
+public:
+ void push(const std::string&); /** @brief append to stack */
+ const std::string& pop(); /** @brief remove and return last value on stack */
+ const std::string& peek(); /** @brief return but keep last value on stack */
+ unsigned size(); /** @brief get size of stack */
+
+public:
+ Stack();
+ virtual ~Stack();
+
+private:
+ std::vector<std::string> _stack;
+};