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

28
Exam/part1/TQueue.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef PART1_TQUEUE_H
#define PART1_TQUEUE_H
#define MAX_SIZE 100
#include "TDoublyLinkedList.h"
class TQueue {
private:
std::string queue[MAX_SIZE];
int head = 0;
int tail = 0;
int count = 0;
public:
TQueue() = default;
~TQueue() = default;
void Enqueue(const std::string& text);
std::string Dequeue();
[[nodiscard]] int GetTail() const;
[[nodiscard]] std::string Peek() const;
[[nodiscard]] bool IsEmpty() const;
[[nodiscard]] bool IsFull() const;
};
#endif //PART1_TQUEUE_H