This repository contains two mini projects implemented in C++ using Data Structures & Algorithms (DSA) concepts:
- 🏥 Hospital Management System (Priority Queue + Map)
- 📖 Library Management System (Map + File Handling)
These projects demonstrate real-world applications of STL containers, file handling, and object-oriented programming.
- Add new patients
- Serve patients based on severity (priority)
- Display all patient details
- Persistent storage using file handling
map→ Stores patient records with unique IDpriority_queue→ Handles patients based on severity (higher severity served first)- Custom comparator for priority queue
- Patients are stored in a map for quick lookup
- A priority queue ensures critical patients are treated first
- Data is saved in
patientinfo.txtfor persistence
- Add new books
- Delete books
- Search books by ID
- Issue and return books
- Display all books
- File-based storage
map→ Stores books with unique ID- File Handling → Data persistence using
library.txt
- Books are stored in a map for fast access
- Each book has an issued/available status
- Data is saved and loaded from a file
-
C++
-
STL (Standard Template Library)
mappriority_queuevector
-
File Handling (
ifstream,ofstream) -
Object-Oriented Programming (Classes & Objects)
C-Projects/
│
├── Hospital.cpp
├── Library.cpp
├── patientinfo.txt
├── library.txt
└── README.md
g++ Hospital.cpp -o hospital
g++ Library.cpp -o library./hospital
./library- Add patient with severity
- Automatically serves most critical patient first
- Issue/Return books
- Track availability status
- Ensure
.txtfiles exist or will be created automatically - Input should be valid to avoid runtime errors
- Add GUI interface
- Use database instead of file storage
- Improve input validation
- Add search by name (not just ID)
Karthik
⭐ If you found this useful, consider giving the repo a star!