Cleaning up and adding comments

This commit is contained in:
Christopher Sanden
2025-11-18 13:23:54 +01:00
parent d1fa8eda6b
commit e77d7ff21e
14 changed files with 202 additions and 103 deletions

View File

@@ -3,10 +3,10 @@
#define MAX_SIZE 200
#include <stdexcept>
#include "TBST.h"
// Fixed-size circular queue used by the BST and AVL level-order traversals.
// Stores raw pointers to tree nodes (T*). Does not own the nodes.
template <typename T>
struct TTreeQueue {
@@ -22,7 +22,7 @@ struct TTreeQueue {
void Enqueue(T* n)
{
if (n == nullptr)
return;
return; // ignore null pointers, nothing to enqueue
if (IsFull())
throw std::overflow_error("Queue Overflow");
queue[tail] = n;