Cleaning up and adding comments

This commit is contained in:
Christopher Sanden
2025-11-20 15:24:00 +01:00
parent e77d7ff21e
commit a014e4ca73
7 changed files with 102 additions and 27 deletions

View File

@@ -5,7 +5,9 @@
#include "TDoublyLinkedList.h"
// Circular array-based queue implementation.
// Used in Cat 1 to store print jobs (each job is a full document snapshot).
// Demonstrates FIFO behavior through enqueue/dequeue operations.
class TTreeQueue {
private:
std::string queue[MAX_SIZE];
@@ -17,8 +19,8 @@ public:
TTreeQueue() = default;
~TTreeQueue() = default;
void Enqueue(const std::string& text);
std::string Dequeue();
void Enqueue(const std::string& text); // Adds a new job at the tail of the queue.
std::string Dequeue(); // Removes and returns the next job in FIFO order.
[[nodiscard]] int GetTail() const;
[[nodiscard]] std::string Peek() const;
[[nodiscard]] bool IsEmpty() const;