Utilizing Algorithms and Data Structures For The Implementation of A Library Management System
Utilizing Algorithms and Data Structures For The Implementation of A Library Management System
Management System
A Research Project
CIT10333P
By:
Talledo, Chyle
March 2025
TABLE OF CONTENTS
TABLE OF CONTENTS................................................................................................................ 1
APPROVAL SHEET...................................................................................................................... 3
ABSTRACT................................................................................................................................... 4
CHAPTER I................................................................................................................................... 5
INTRODUCTION..................................................................................................................... 5
1.1 Overview of Discussed and Resolved Topics.............................................................. 6
1.2 Purpose of the Algorithm Program...............................................................................7
CHAPTER II.................................................................................................................................. 8
LITERATURE REVIEW............................................................................................................8
2. 1 Previous Works...........................................................................................................9
2.2 Relevance of Chosen Topics..................................................................................... 10
2.2.1 Search Algorithms.............................................................................................10
2.2.2 Hashing Algorithms...........................................................................................10
2.2.3 Sorting Algorithms............................................................................................. 11
CHAPTER III............................................................................................................................... 12
METHODOLOGY.................................................................................................................. 12
3.1 Programming Language and Tools............................................................................ 12
3.2 Topics Implemented................................................................................................... 13
3.3 User Interface Design................................................................................................ 14
CHAPTER IV............................................................................................................................... 16
IMPLEMENTATION DETAILS................................................................................................16
4.1 Code Explanation.......................................................................................................16
4.1.1 Fetch Suggestion Function............................................................................... 16
4.1.2 Fetch Books Function...................................................................................... 16
4.1.3 Editable Function.............................................................................................. 17
4.2 Challenges Faced...................................................................................................... 18
CHAPTER V................................................................................................................................ 19
RESULTS AND EVALUATION...............................................................................................19
5.1 Testing........................................................................................................................19
5.2 Evaluation of Effectiveness........................................................................................27
5.2.1 Assess Functionalities...................................................................................... 27
5.2.2 User Feedback..................................................................................................28
1
APPROVAL SHEET
The research paper here attached, entitled "Utilizing Algorithms and Data Structures for The
Talledo, Jan Drake Robillo, and Emil Claude Villegas in partial fulfillment of the requirements
Maxil S. Urocay
Date signed:
Noted By:
Elmer T. Haro
College Dean
Date signed:
ABSTRACT
This project is about creating a Library Management System that uses basic computer
science tools like algorithms and data structures to make library tasks faster and easier. The
system includes features such as searching for books, sorting book lists, and keeping passwords
safe using hashing. It was built using Python, Flask, SQLite, and web tools like HTML, CSS,
and JavaScript. The system is designed for two types of users—students and admins—each with
their own set of features. Students can search for and borrow books, while admins can add or edit
book details. The system is easy to use, fast, and secure. During testing, all features worked
smoothly, and users found the system helpful and easy to understand. Although combining all
parts of the system was challenging at first, the team was able to solve the problems with online
help and careful design. This project shows how computer science concepts can be used in real
Keywords: Library Management System, Algorithms, Data Structures, Book Search, Sorting,
CHAPTER I
INTRODUCTION
that traditional systems will become inefficient and unusable in managing larger amounts of data.
Because of this fact, libraries have shifted from manual systems, where the process of adding
new books, new students, issuing, and returning books had to be managed manually, which is
very slow and inefficient (IJRASET, 2022.)—to automated systems in order to focus on better
customer service. The massive number of books to manage implies that it is now imperative to
efficiently process and make library resources available to users, as every user should have
information to students, allow them to borrow books based on availability, and enhance
convenience for librarians. It provides a user-friendly interface where librarians can easily
perform all library operations (IJRASET, 2022.), enabling them to focus more on providing
quality services to patrons rather than being overwhelmed by administrative tasks (IJNRD,
2024). Additionally, the researchers have added layers of authentication to secure routes used by
respective users. Modern library management systems are built to scale against data and remain
efficient in handling different volumes of data. Unlike traditional library management systems,
they allow for the creation of an unlimited quantity of digital information and make it available
5
can also remotely use the system from anywhere and in parallel with other users.
The program utilizes four different algorithms in creating a website which provides the
necessary algorithms for the library management system. The system provides storage for
passwords when creating user accounts, the password hashing was needed for password
security. User passwords are stored in a cryptographic hash function which allows the conversion
of passwords into fixed-length hash. Its time complexity is O(1) constant time in password
verification and typically used for authentication systems in storing user information.
Furthermore a search function was utilized to help users navigate the library system to efficiently
access book information. Search algorithm is implemented for the search bar to allow users to
search books dynamically which utilizes SQL queries with indexing for fast retrieval. Its time
complexity is similar to a binary search which is O(log n) logarithmic time if the database is
indexed because without one, it becomes O(n) linear time. A few real life applications of the
search algorithm are search engines and database management systems. Lasly, the study utilizes
sorting algorithms such a combination of merge sort and insertion sort through JavaScript to sort
books by their titles alphabetically. This is to help organize the books which allows users to
expand their way of accessing books. In a real life scenario, it is essential in e-commerce product
listing and leaderboards. The time complexity of the hybrid sorting algorithm is O(n log n)
linearithmic time.
The library management system was made for users to easily access and borrow books
for both students and librarians and it consists of many features with their own algorithms. One
of the algorithms implemented is the search algorithm to allow both students and librarians to
access information about the books. The search algorithm is utilized by interacting with the
search bar which allows users to type information about specific details on a book for an efficient
book tracking. Additionally, the sorting algorithm is utilized when managing books which sorts
out the books by their title to help ease when navigating or editing the books. This will provide
users the realization of how important organization, management and sorting is when storing big
data such as book information. Regarding the safety of user accounts, a password security feature
was implemented to secure passwords and provide a smooth transition from logging in to
accessing the library management system. The password hashing algorithm can be utilized by the
user in account creation and access to prevent access from unauthenticated users.
CHAPTER II
LITERATURE REVIEW
The transition from manual to automated library management systems has been a massive
alike. Dutta, Nite, and Karmakar (2022) highlight how automation streamlines processes such as
book tracking, user authentication, and borrowing management, reducing the workload on
librarians and enhancing user experience. Similarly, the study by the International Journal for
Research in Applied Science & Engineering Technology (IJRASET, 2022) emphasizes the
optimize book retrieval and organization. These studies point out the fact that library
management systems built using algorithms and data structures significantly improve the
discusses the role of hashing algorithms in safeguarding user credentials and preventing
unauthorized access. Another study done by the International Journal of Novel Research and
Development (IJNRD, 2024) explores user-centric designs that prioritize ease of access while
maintaining data integrity. By using indexed searching algorithms, libraries obtain an efficient,
faster way to query a user's input, ensuring efficient book retrieval. These works emphasize the
significance of integrating algorithms and data structures into library management systems.
2. 1 Previous Works
The evolution of library management systems has been a focal point of research, especially
when it comes to enhancing user experience, accessibility, and efficiency. Effective management
solutions are becoming more and more important as libraries move from manual, old systems to
advanced digital platforms. The quick development of technology, which has made it possible
for libraries to automate numerous procedures, optimize operations, and improve service
Recent years have seen a revolution in library resource management and user interaction
due to the incorporation of cutting-edge technology like cloud computing, mobile applications,
and data analytics. Users can now access library services from anywhere at any time thanks to
these developments, which also make it easier to organize and retrieve information.
Additionally, by prioritizing the requirements and preferences of library users, solutions that
boost their pleasure and engagement have been developed as a result of the emphasis on
user-centric design.
A study by Dutta, Nite, and Karmakar (2022) explores the design and implementation of
an Automated Library Management System, emphasizing its role in simplifying and automating
library operations. The system addresses the challenges of manual management by digitizing
processes such as book tracking, member management, and issue-return operations. The authors
highlight that the automation of these tasks significantly reduces the workload of library staff and
improves overall efficiency. By transitioning from manual to automated systems, the study
9
demonstrates how technology can enhance the maintenance and organization of library
In the context of our research on Utilizing Algorithms and Data Structures for The
algorithms, hashing algorithms, and sorting algorithms plays a pivotal role in enhancing the
performance, efficiency, and user experience of the application. Understanding the theoretical
and practical relevance of these algorithms is essential for achieving the objectives of our study.
One essential component is the ability to effectively retrieve information from large
databases, which is made possible by efficient query algorithms. For example, our application's
response times are significantly improved through optimized database querying techniques, such
as using indexed searches, which allow for fast access to user records or library catalogs. With a
time complexity that can approach O(log n) when indexes are properly implemented, these
query strategies are especially valuable when working with extensive datasets, so it's critical
because user satisfaction is tied to the speed and accuracy of data retrieval.
Our research relies heavily on hashing algorithms, particularly when it comes to user
data management and guaranteeing fast access to commonly used resources. We can design
effective data structures, such hash tables, that support average-case time complexities of O(1)
10
for lookups and insertions by utilizing hashing techniques. This is especially useful for
monitoring borrowed objects, maintaining user sessions, and putting features like user
component of any application handling personal data cryptographic hashing techniques improve
security. Hashing is a crucial part of our system design since it is relevant to our research in both
Sorting algorithms are essential for organizing data in a manner that facilitates efficient
access and analysis. In our research, algorithms such as QuickSort or MergeSort can be
employed to sort library resources, user records, or transaction histories. The theoretical
O(n log n), ensures that our application can handle large datasets effectively. Sorting is crucial
for features such as generating lists of available books, organizing user requests, and presenting
enhance the overall usability of our application, leading to improved user engagement and
satisfaction.
11
CHAPTER III
METHODOLOGY
The system was developed using a suite of programming languages, frameworks, and
Python: Used as the primary backend programming language for handling core functionalities,
Flask: A lightweight Python web framework employed to create the server-side application,
SQLite: A lightweight relational database system used to store and manage structured data
Jinja2: Integrated with Flask as the templating engine, allowing dynamic rendering of HTML
HTML and CSS: Provided the structural layout and visual styling for the web interface,
Bootstrap: A CSS framework utilized to streamline the design process and ensure responsive,
Search Algorithms:
The system allows users to search for books by keywords or titles. This involves the
implementation of basic string matching and filtering algorithms, which iterate through records
to find matches efficiently. This functionality is critical for user experience and system
responsiveness.
The program distinguishes between two types of users — admins and students — and
application of access control algorithms and design patterns, ensuring each user only sees and
The backend handles multiple routes (URLs) using Flask’s routing system. Each route is
mapped to specific controller logic, implementing basic state management and control flow.
This involves concepts of stateful request handling and the use of decorators to manage HTTP
13
The system includes input validation and structured error-handling mechanisms to catch
invalid data entries or failed operations. This ensures system robustness and is based on control
The system allows Create, Read, Update, and Delete (CRUD) operations on book and
user data. These operations are tied to SQL queries under the hood, managed via Python and
This section focuses on discussing how the GUI of the system is designed to make it
For the first user interface, the user will see a homepage where the user has to choose
between two main buttons on the right side to indicate whether the user is an admin or a student,
which will then lead to their respective login pages. On the top left of the home page, there is a
sign-up page link for student and admin users. After logging in, the user will be shown a list of
For the student users, they are provided with options on what books to borrow. They are
only required to press the button displayed as “borrow” and they will be given an input field for
the date to borrow, and when clicked, will show an interactive calendar which the user can click
14
to input a specific day in the system. Another button at the top left is the myBooks, where users
can see the lists of the borrowed books they have borrowed. In summary, the student users can
input data by clicking buttons to borrow and select the date for borrowing.
For admin users, after logging in, the interface will display two main buttons to add or
search for books. After clicking the search book button, the interface will display similarly to
the student user interface, where the list of books is shown, the only difference is that instead of
a borrow button shown for each book, the admins are able to edit the books. When clicking the
edit button, it will show multiple fields for typing and drop-down lists, and buttons that the user
may interact with to edit the information of a book, such as the picture, the book’s and author’s
name, the number of books, its availability, the ISBN, floor location, and section/category. And
for the add book button, similar to the edit, where multiple fields and buttons are provided to fill
For the search bar function in the system, it can be used by both admin and student users,
where they can type out the title of a book, and while typing, the system will try to find existing
Overall, the look or appearance of the user interface is user-friendly because the design
is simple and organized properly. The font is appropriate and is readable, and the buttons are
fitted well enough that they are not overemphasized or hidden, so that users are not distracted by
them, and they are noticeable. The color theme is also pleasing to the eyes, and the interface is
visually interactive, such that when the cursor is hovering over a button, the button will change
its color to indicate it can be clicked. Lastly, there are error validations in the signup or login
15
page. As a result, the system provides a user-friendly experience, shown by how the GUI is
CHAPTER IV
IMPLEMENTATION DETAILS
This section tells about the main functions and algorithms implemented in the system. It
discussed each function’s handling of inputs, how it is processed, algorithms, and its integration
This function’s purpose is to fetch books depending on what the user types into the
search field, to suggest and display a list of the books’ titles below. When the user inputs the
current text, it sends it to the URL via an AJAX request, and it will search for a book title to
match what the user inputted, then it sends back a list of suggestions. When the suggestions are
returned, the old ones, if there are any, are removed, and the new suggestions are sorted in a
drop-down style list for display to the user. Overall, the function runs in about O(n log n), it is
mostly affected because of sorting, which is still fast and efficient for small to medium-sized
suggestion lists
This function displays to the user the list of books with their information based on the
16
user’s input which is queried. Then it is processed by creating a search link and sending it to the
URL and returning book data in the format called JSON so that the function can go through the
book list and build cards for each book for display. The users will then be able to see cards for
For student users, there is also the Borrow function within the Fetch Books for students
that, when the user clicks the “Borrow Button,” displays a calendar to select a date, and when
confirmed, it sends the selected date to the server to update the book as borrowed.
Overall, the Feth Books Function runs in about O(n) due to each book and card being
This function allows users to edit book details directly from the webpage. When an
admin clicks the edit button on a book then it changes all the details inside the book into
editable fields, and each data has different ways of inputting details. It takes input by looking
inside a section of the book card and finds every piece of text that has a data-type tag to tell
what kind of info it is. It processes the data by checking each field for its data type and changes
it into editable input fields. What the users would see if they click the edit button is that the
normal book information changes into input boxes or dropdowns, which update live using
JavaScript and jQuery. As a result, it runs in O(n) because of the number of editable fields it has
to check.
17
One of the primary challenges encountered by the researchers was the integration of the
frontend, backend, and database components into a cohesive project. Although the researchers
possessed prior knowledge of each individual component, combining them presented unforeseen
especially bugs in filtering the two user roles, admin and students. Additionally, bugs revolving
around querying inputs, passing these inputs, and formatting these inputs into informative data
techniques. For issues related to code logic or syntax, they frequently sought assistance from
ChatGPT to diagnose and resolve problems. Furthermore, designing an intuitive and visually
18
CHAPTER V
5.1 Testing
Student IDs follow a 13 digit format to easily filter what is valid and is invalid. In the
19
Similar to figure 1, the admin’s ids follow a specific format of having 10 digits only.
Only admins can have these ids, and there will be no way for students to try and access the
admin controls.
20
In the sign up section of students, they are restricted from inputting non-alphabetical
21
Similar to the student side, admins are also restricted from inputting non-alphabetical
22
ISBNs follow a 13-digit format, and in the add book function of admins, the program
23
In the add book function of admins, they cannot input a value that is less than 1. This
makes sure that every inputted book will have at least a value of 1.
Admins cannot edit a book’s count to be negative. To make sure that there will be no
negative book counts, the program will take 0 as its default value.
24
To disable invalid date selections in borrowing, students are restricted from choosing a
25
To restrict students from borrowing the same book twice, the borrow button will be
disabled after borrowing once. The button will be enabled again once they have returned the
book.
26
evaluated through testing each functionality existing in the system, such as searching, access
control, data manipulation algorithms, and route, request, and error handling. When it comes to
evaluating its effectiveness from users, it will be limited to users within the group; as such, user
feedback is limited. It is noted that with the limited user testing, the group can thoroughly
evaluate and effectively create certain evaluations on how the algorithms function. Furthermore,
the evaluation also considers how the user interface helps in understanding and interacting with
the algorithms and complexities of the features, and finding out possible issues and challenges.
After careful testing on each functionality, the result was that they reached satisfactory
performance in their task. First was the Searching Algorithms, so the Query was tested and
resulted in instantaneous responses when searching for books in the virtual library. Next was the
Hashing Algorithms, this algorithm goes hand in hand with the search algorithm, so that it
guarantees fast access to the used resources as well as data management for each book, users,
and helps in security. The features that included hashing algorithms were functioning well,
which feels smooth enough that it does not have any big delays on interacting with the system.
The last one that was tested is the sorting algorithms, which are most prominent in the fetch
books and the suggestion function when searching, and the result was quick to generate the list
of suggested books in a drop-down list and through card displays in an organized manner.
27
Through the testing of the program by the group, the overall thought of how it helped the
users to understand the algorithm's behavior was that it can be easily understood through the
help of the program being visually interactive or dynamic. An example of this is the fetch
suggestion function when searching for books. When inputting letters in the search bar, it is
prominent that users can see that every time they type a single letter, the drop-down list is
dynamically updated, as well as the card displays. It can be understood by the users that the
algorithm waits for user input and updates it through the list of books, and chooses matches.
Furthermore, there were no known complaints or issues found that would hinder the
functionalities due to error handling implementation. As a result, the functions were evaluated
and performed their task as intended, and displayed smooth operations in each functionality.
Based on the group’s experience with testing, the functionalities of the program were
easy to interact with since the UI was designed to be simplistic, interactive, and user-friendly to
not overwhelm the users with information for navigation and interaction. Due to its dynamic
visual updates on features such as the search function, users are able to easily visualize the
algorithm’s behavior and complexity. In simple terms, there are visual indications to know that
something has changed when interacting with parts of the UI. Lastly, there were no major
issues, only minor ones like difficulty navigating at first, but eventually it became easy in the UI
when interacting.
28
CHAPTER VI
CONCLUSION
The Library Management System successfully achieved its goals by using important
computer science concepts like search, sort, and password security algorithms. The search
feature worked quickly and helped users find books easily, while the sorting feature made book
lists organized and easier to navigate. The password security system protected user accounts by
using hashing to keep login details safe. The program also managed user access by giving
different features to students and admins. Features like book borrowing, adding books, and
account creation worked well without delays, showing that the algorithms were efficient and
reliable.
The system also helped users understand how the algorithms work by using a clean and
simple design. For example, the search bar updated suggestions instantly as users typed, helping
them see how the search algorithm responds in real-time. Clear messages and smooth
interactions made the system easy to use. Even with limited testing, the system showed strong
performance and was easy to understand, helping users learn about algorithm behavior through
In the future, the Library Management System can be improved by adding smarter and
29
faster algorithms. For example, using better sorting methods like Quick Sort or Merge Sort can
help the system work faster when handling a large number of books. It is also better to use more
advanced search methods to make finding books even quicker. Additionally, another idea is to
add visual tools that show how these algorithms work step by step. This would help users,
especially students, understand what’s happening in the background when they search or sort
books.
While building the system, one of the biggest challenges was putting together the
frontend, the backend, and the database. Even though understanding each part separately is easy
but combining them caused a lot of unexpected problems. The troubles were with user roles
(student vs. admin), handling data inputs, and showing data in a useful way. It was also a little
hard to design a simple and clear user interface. In the possible future versions, making the
system easier to use and making sure it clearly shows how the algorithms work would be ideal.
30
APPENDICES
31
32
33
34
35
REFERENCES
IJRASET. (2022). Library management system. International Journal for Research in Applied
https://www.ijraset.com/research-paper/library-management-system
IJNRD. (2024). Library management system: Enhancing library services through automation.
https://www.ijnrd.org/papers/IJNRD2405463.pdf
Library Philosophy and Practice. (2023). Library resources and their accessibility to users.
https://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=15334&context=libphilprac
Tochukwu, C., Nwachukwu-nwokeafor K.C & Udeani Henrieta (2015). Designing a web-based
digital library management system for institutions and colleges. Retrieved from
https://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=15334&context=libphilprac
Dutta, P., Nite, N. R., & Karmakar, R. (2022). Design and implementation of an automated
http://103.36.255.173/handle/123456789/288
and Innovations in Engineering (ICRAIE) (Vol. 6, pp. 1–6). IEEE. Retrieved from
36
https://ieeexplore.ieee.org/abstract/document/9703998/
Alwadi, A., Kilby, J., & Gawanmeh, A. (2017). Tracking and automating a library system using
https://search.proquest.com/openview/3e7f9d5eca974f01c79b4d334533f3de/1?pq-origsit
e=gscholar&cbl=5316521
37
CURRICULUM VITAE
38