Files
Datastructs/Exam/part1/TStack.h
Christopher Sanden a8006be05f Adding exam part 1/4
2025-11-03 21:30:23 +01:00

37 lines
569 B
C++

#ifndef PART1_TSTACK_H
#define PART1_TSTACK_H
#define STACK_MAX_SIZE 100
#include <string>
enum EnumActionType {
INSERT,
DELETE
};
class TStack {
private:
struct TAction {
EnumActionType action;
std::string text;
int index;
};
TAction event[STACK_MAX_SIZE]{};
int top = 0;
public:
TStack() = default;
~TStack() = default;
void Push(const TAction& action);
TAction Pop();
[[nodiscard]] TAction Peek() const;
[[nodiscard]] bool IsEmpty() const;
void Clear();
};
#endif //PART1_TSTACK_H