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,12 +3,15 @@
#include "TPerson.h"
// Singly linked list of TPerson, used for the guest and employee manifests.
// Owns all its Node objects and frees them in the destructor.
// Supports append, prepend, insert, remove, indexed access, and merge-sort.
class TLinkedList {
private:
struct Node {
TPerson person;
TPerson person; // stored by value
Node* next;
explicit Node(const TPerson& p) : person(p), next(nullptr) {}