Adding exam part 1/4

This commit is contained in:
Christopher Sanden
2025-11-03 21:30:23 +01:00
parent d6e494cf1c
commit a8006be05f
95 changed files with 12245 additions and 25 deletions

37
Exam/part1/TStack.h Normal file
View File

@@ -0,0 +1,37 @@
#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