Skip to content

The Library Management System(LMS) is a simple data structures project implemented in the C programming Language using a Single Linked List (SLL).

Notifications You must be signed in to change notification settings

hazracodegit/Data-Structures-Library-Management-System-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Data-Structures-Library-Management-System-Project

The Library Management System(LMS) is a simple data structures project implemented in the C programming Language using a Single Linked List (SLL).

๐Ÿ“š Library Management System (C Project using Singly Linked List)

๐Ÿงฉ Overview

The Library Management System is a Data Structures project implemented in C using a Singly Linked List (SLL). It manages a collection of books, allowing users to add, delete, borrow, return, search, and display books dynamically.

This project provides a clear demonstration of how linked lists can be used for dynamic data handling without using databases or arrays.


๐ŸŽฏ Features

โœ… Add Book โ€“ Add a new book record with ID, title, and author. โœ… Display Books โ€“ Show all books available in the library. โœ… Search Book โ€“ Search a book by its ID. โœ… Delete Book โ€“ Remove a book record permanently. โœ… Borrow Book โ€“ Mark a book as borrowed (not available for others). โœ… Return Book โ€“ Mark a borrowed book as returned. โœ… Exit โ€“ Close the program safely.


โš™ Data Structure Used

This project uses a Singly Linked List (SLL) to store book details dynamically. Each node represents one book and contains:

struct Node { int id; char title[50]; char author[50]; int isBorrowed; // 0 = available, 1 = borrowed struct Node* next; };

id โ†’ Unique book ID

title โ†’ Title of the book

author โ†’ Author name

isBorrowed โ†’ Status of the book (available or borrowed)

next โ†’ Pointer to the next node (book)


๐Ÿง  Core Operations

1๏ธโƒฃ Add Book

Prompts user to enter ID, title, and author.

Dynamically creates a new node and inserts it at the beginning of the list.

2๏ธโƒฃ Display Books

Traverses the linked list and displays all book details.

Shows whether each book is Available or Borrowed.

3๏ธโƒฃ Search Book

Searches a book by its unique ID.

Displays full book details if found.

4๏ธโƒฃ Delete Book

Deletes a book record from the linked list by ID.

Frees the memory using free() to avoid memory leaks.

5๏ธโƒฃ Borrow Book

Allows a user to borrow a book if it is available.

Changes the isBorrowed flag to 1 and marks it as โ€œBorrowedโ€.

6๏ธโƒฃ Return Book

Marks a borrowed book as returned.

Updates isBorrowed flag back to 0.

7๏ธโƒฃ Exit

Terminates the program safely and frees all dynamically allocated memory.


๐Ÿงฎ Algorithms Used

Operation Algorithm Summary

Insert Traverse till last node โ†’ link new node at end Search Traverse and compare IDs until found Delete Locate node before target โ†’ adjust pointer links Borrow/Return Traverse โ†’ find by ID โ†’ change status flag Display Traverse โ†’ print all node data


๐Ÿ–ฅ Sample Menu

========= ๐Ÿ“š LIBRARY MANAGEMENT SYSTEM =========

  1. Add Book
  2. Display Books
  3. Search Book
  4. Borrow Book
  5. Return Book
  6. Delete Book
  7. Exit Enter your choice:

๐Ÿ’พ Example Output

Enter your choice: 1 Enter Book ID: 101 Enter Title: Data Structures in C Enter Author: Yashwanth Kanetkar โœ… Book added successfully!

Enter your choice: 4 Enter Book ID to borrow: 101 ๐Ÿ“– Book borrowed successfully!

Enter your choice: 2 ID: 101 Title: Data Structures in C Author: Yaswanth Kanetkar Status: Borrowed


๐Ÿงฐ Tools Used

Language: C

Compiler: GCC

IDE : Dev C++

Concepts Used: Structures, Pointers, Dynamic Memory Allocation, Singly Linked List


๐Ÿš€ Future Enhancements

Add File Handling to store records permanently.

Add Sorting (by title, author, or ID).

Add User Accounts and Fine Calculation for overdue returns.

Add Graphical Interface or building using Web Stack.


๐Ÿงพ Conclusion

This Library Management System demonstrates how Singly Linked Lists can be used to manage real-life data dynamically. It helps to understand:

Linked List traversal

Dynamic memory allocation

Node insertion, deletion, and modification

Real-world data handling using data structures

This project is ideal for beginners learning C programming and Data Structures.

About

The Library Management System(LMS) is a simple data structures project implemented in the C programming Language using a Single Linked List (SLL).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages