A console-based Hospital Management System written in C, built as a data structures showcase with three role-based logins — Admin, Doctor, and Patient — layered on top of six classic data structures working together instead of standing alone as toy demos.
- Admin — manage doctors, set booking limits, browse/search patients, view today's appointments.
- Doctor — dashboard with live stats, treat next patient (heap checked first), toggle availability.
- Patient — register, book/cancel appointments, view medical history.
| Structure | Used for | Why it fits |
|---|---|---|
| Circular Queue | Regular appointment line per doctor | FIFO, fixed size, no shifting overhead |
| Min-Heap | Emergency triage per doctor | Highest urgency always at the root |
| Binary Search Tree | Patient records by ID | O(log n) lookup, soft-delete keeps it simple |
| Hash Table | Doctor ID → Doctor* lookup | O(1) average lookup, open addressing |
| Doubly Linked List | Doctor registry | Easy full traversal for Admin |
| Singly Linked List | Medical history per patient | Simple append-only record trail |
flowchart TD
Start[Homepage] --> Role{Select Role}
Role -->|Admin| AdminPortal[Admin Portal]
Role -->|Doctor| DoctorPortal[Doctor Portal]
Role -->|Patient| PatientPortal[Patient Portal]
AdminPortal --> Manage[Manage Doctors & Patients]
PatientPortal --> Book[Book Appointment]
Book --> Check{Emergency?}
Check -->|Yes| Heap[(Min-Heap)]
Check -->|No| Queue[(Circular Queue)]
Heap --> Wait[Waiting for Doctor]
Queue --> Wait
Wait --> Treat[Doctor Treats Patient]
DoctorPortal --> Treat
Treat --> History[(Medical History)]
Manage --> Storage[(Saved to Storage)]
History --> Storage
The three portals sit at the top, feeding into two simple branches: Admin manages records directly, while Patient bookings get sorted by urgency — emergencies through the min-heap, everyone else through the FIFO queue — before a doctor treats them. Every path ends up saved to disk.