Skip to content

Karthik7-github/C-Projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

📚 C++ DSA Projects Collection

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.


🚀 1. Hospital Management System

📌 Features

  • Add new patients
  • Serve patients based on severity (priority)
  • Display all patient details
  • Persistent storage using file handling

🧠 DSA Concepts Used

  • map → Stores patient records with unique ID
  • priority_queue → Handles patients based on severity (higher severity served first)
  • Custom comparator for priority queue

⚙️ How It Works

  • Patients are stored in a map for quick lookup
  • A priority queue ensures critical patients are treated first
  • Data is saved in patientinfo.txt for persistence

📖 2. Library Management System

📌 Features

  • Add new books
  • Delete books
  • Search books by ID
  • Issue and return books
  • Display all books
  • File-based storage

🧠 DSA Concepts Used

  • map → Stores books with unique ID
  • File Handling → Data persistence using library.txt

⚙️ How It Works

  • Books are stored in a map for fast access
  • Each book has an issued/available status
  • Data is saved and loaded from a file

🛠️ Technologies Used

  • C++

  • STL (Standard Template Library)

    • map
    • priority_queue
    • vector
  • File Handling (ifstream, ofstream)

  • Object-Oriented Programming (Classes & Objects)


📂 File Structure

C-Projects/
│
├── Hospital.cpp
├── Library.cpp
├── patientinfo.txt
├── library.txt
└── README.md

▶️ How to Run

Compile

g++ Hospital.cpp -o hospital
g++ Library.cpp -o library

Execute

./hospital
./library

📸 Sample Functionalities

Hospital System

  • Add patient with severity
  • Automatically serves most critical patient first

Library System

  • Issue/Return books
  • Track availability status

⚠️ Notes

  • Ensure .txt files exist or will be created automatically
  • Input should be valid to avoid runtime errors

💡 Future Improvements

  • Add GUI interface
  • Use database instead of file storage
  • Improve input validation
  • Add search by name (not just ID)

👨‍💻 Author

Karthik


⭐ If you found this useful, consider giving the repo a star!

About

C++ projects implementing Hospital and Library Management Systems using Stack and Priority Queue to demonstrate efficient data handling and priority-based operations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages