Welcome To Our Presentation
Clinic Queue Management System
Dynamic FIFO Patient Scheduling in C++ Using Singly Linked Lists
WELCOME TO OUR TEAM
Innovation University · Group 24 · 5 Members
Marwan Yasser Metwally
25030215
Group 24
Ziad Lotfy Abdelraziq
25030489
Group 24
Yousef Ahmed Yousef
24030148
Group 24
Mohamed Emad Mohamed
25030338
Group 24
Manual Queues and Fixed Arrays Create Bottlenecks
Clinic bottleneck analysis · Static data structures limit operational scalability
Unfair Service Order
Manual clipboard tracking leads to inconsistent prioritization, lost patient sequence, and dispute at triage.
Memory Inefficiency
Static arrays reserve pre-allocated memory pools upfront, idling unused space during quiet clinic shifts.
Hard Overflow Boundaries
Fixed boundaries cause fatal overflow errors when unexpected emergency arrivals exceed preset buffer capacity.
A Dynamic FIFO Queue Organizes Patient Flow
A custom C++ console application replaces guesswork with a singly linked list structure operating under strict First-In, First-Out discipline.
Zero-Abstraction Pointer Control
Engineered purely on native pointers and heap management without relying on STL containers. Every node reference and memory transition is explicitly authored and verified.
PatientNode* node = new PatientNode(id, name);
On-Demand Node Lifecycle
Nodes allocate dynamically on arrival and deallocate upon departure, eliminating static ceilings. Memory footprint scales 1:1 with the active clinic waiting room.
delete dischargedNode; // instant heap reclamation
Build the Queue from Scratch
Eliminating third-party libraries exposes full control over dynamic memory, pointer safety, and algorithmic complexity.
Zero STL Dependency
Queue and linked list nodes are written directly from C++ primitives using explicit pointer references and dynamic operators (new / delete).
<queue> · No <list>
O(1) Enqueue & Dequeue
Front and rear pointers maintain instant constant-time admission and discharge without requiring linear list traversals.
Inspect & Traverse
Linear scan operations display full waiting rosters and locate specific patient records by ID in O(n) worst-case time.
Nodes and Two Pointers Power the Queue
The queue holds a front pointer for discharges and a rear pointer for new admissions.
0x1A48
0x1B10
nullptr
nullptr
End of List
front references the head node to be serviced next; advances via front = front->next on dequeue.
rear targets the last arriving patient node; its next pointer resolves to nullptr.
Empty state invariant: front == nullptr && rear == nullptr
Queue Operations and Time Complexity
Constant-time core queue primitives pair with linear diagnostics for routine clinic management.
| Operation | Time Complexity | Pointer Mechanics | Critical Edge Case |
|---|---|---|---|
| Enqueue Admit Patient | O(1) | Allocates node via new, links rear->next, updates rear |
If empty, front and rear both point to new node |
| Dequeue Call Next | O(1) | Saves front node, advances front to next, calls delete |
If queue becomes empty, sets rear = nullptr |
| Search Find by ID | O(n) | Traverses from front checking target patient ID until match |
Returns not found if list exhausts |
| Display Print Roster | O(n) | Walks node-by-node printing formatted patient roster | Notifies console immediately if empty |
A Simple Console Menu Drives the Workflow
A persistent console loop processes administrator input and routes actions directly into queue operations.
=== CLINIC QUEUE MANAGEMENT SYSTEM ===
[1] Add Patient (Enqueue)
[2] Call Next Patient (Dequeue)
[3] Search Patient by ID
[4] Display Waiting Roster
[5] Exit & Release Memory
--------------------------------------
> Enter choice: 1
> Patient ID: 104
> Patient Name: Nadia Samir
[OK] Enqueued #104 (Nadia Samir) at rear (0x1B80) in O(1).
Live Singly Linked List Queue Simulator
Test real-time FIFO admissions, discharges, pointer updates, and O(n) ID search directly in the browser.
nullptr
nullptr
0
true
Memory-Safe C++ Implementation
Clean object-oriented encapsulation with explicit pointer management and leak-free destructor cleanup.
Thank You for Your Attention
Dynamic singly linked lists deliver strict FIFO fairness, constant-time triage transitions, and zero static memory waste.
Instant Admissions & Calls
Dual front and rear pointers guarantee predictable throughput under peak load.
Dynamic Heap Allocation
Memory grows and shrinks cleanly with patient volume without fixed array limits.
Deterministic Cleanup
Iterative destructor traversal reclaims every allocated PatientNode on exit.
Thank You for Listening
Innovation University · Faculty of Computers & Information Technology · Group 24