Completed BST and most of infrastructure for the whole section
This commit is contained in:
29
Exam/IKT203Exam/Portfolio/SharedLib/TTreeQueue.h
Normal file
29
Exam/IKT203Exam/Portfolio/SharedLib/TTreeQueue.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef TQUEUE_H
|
||||
#define TQUEUE_H
|
||||
#define MAX_SIZE 100
|
||||
|
||||
#include "TDoublyLinkedList.h"
|
||||
|
||||
|
||||
|
||||
class TTreeQueue {
|
||||
private:
|
||||
std::string queue[MAX_SIZE];
|
||||
int head = 0;
|
||||
int tail = 0;
|
||||
int count = 0;
|
||||
|
||||
public:
|
||||
TTreeQueue() = default;
|
||||
~TTreeQueue() = 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 //TQUEUE_H
|
||||
Reference in New Issue
Block a user