By clicking “Check Writers’ Offers”, you agree to our terms of service and privacy policy. We’ll occasionally send you promo and account related email
No need to pay just yet!
About this sample
About this sample
Words: 1038 |
Pages: 2|
6 min read
Published: Mar 18, 2021
Words: 1038|Pages: 2|6 min read
Published: Mar 18, 2021
This report is based on a real-world problem solved by a number of students of the Government Engineering College, Gandhinagar in India. The main purpose is to delve into their project and discuss the data structure used in achieving the objectives of the project. They worked on a library management system, using the C programming language to aid them. Linked list was the data structure they preferred to use in their program although they had the choice of other data structures, like arrays. Their program had core features of traditional library management such as adding books, returning books, borrowing/ issuing books, viewing records of books issued and categorizing books into different departments, among other features. Their program run successfully, and linked list was the data structure that played an important role.
The library management system is a project that several people have tackled for several years, hence this is not a maiden project. This system is convenient in tackling most of the problems faced when using the traditional book systems in libraries. Computerizing this traditional system has done a lot of good. It is also because of this good that people never tire of tackling this same project all around the globe. The library management system provides a user-friendly interface, is prone to less errors, has grater storage capacity, the search feature is better and over all dealings between library keepers/administrators and users is quick.
This library management system was created, but behind every computer program is a data structure that determines how data is stored in the computer memory, that is, how data is allocated. The main aim of this report is to state clearly what data structure was used to achieve the objectives of the project, and how that data structured helped in doing that.
A console application was implemented using the C language to implement the system. The code was compiled in Code blocks and the GCC compiler was used. The program was created to perform the everyday functions that happen in a library, it even added features to enable one check how many/ what books are in stock and if desired, make purchases. Displaying books in a library, adding books to the library, borrowing books (displaying borrowed books), retuning books (deleting records of books when returned) and registering users. Some features are restricted to administrative use whiles others are open to all. From this, it is obvious why linked lists were used to achieve this.
One pressing issue that people face when working on a computer program is the data structure that would be most appropriate. There is a variety of data structures to choose from, but what distinguishes them is the purpose of the program. The program tells which data structure would be most suitable for the task at hand. Looking at the library management system, the most prominent activities are inserting, deleting, and searching. With these activities in mind, it is up to one to decide which data structure does all the above and utilizes the most resources (space and time). After critically thinking through things like this, this project was handled with linked lists.
With linked lists (a linear data structure), there are types and various means of implementation. In linked lists, the data items are stored in links (a link is an object of a class). There are singly linked lists, double linked list and doubly linked list. Singly linked list is where the main linked list class only points to the first link in the list (has one data member) and all successive links just point to the next/proceeding link. It is easy to insert and delete only the first link. Insertion and deletion of first item has O (1) whiles searching for an item has O(n). A double linked list has a linked list class with two data members: one pointing to the first link in the list and the other to the last, the links in between just point to the proceeding link. With this it is easy to insert and delete the first link and insert at the last link. But with a doubly linked list, all the links have pointers to the previous link as well as the proceeding link. With this type of linked list, insertions and deletions can be done at any part of the link with O (1), it is just a matter of changing the pointers, whether in previous or current links. Knowledge from members of the project makes us know a doubly linked list was specifically used, since it was stated that a linked list in which elements can be added or deleted from anywhere was used. In every link, there are data members or objects that point to various data members like user’s name, ID, book title, book authors, etc. hence any of the data members / objects can be used as search keys when searching for specific things (like a person’s file/status of books – whether borrowed or not). The keys should be unique to a person or book.
When new books are brought into the library, the administrator can simply add those books to the link of the linked list class for new books, when someone borrows a book it can be added to their link of borrowed books, when a person returns a book, it can easily be deleted from the link, even when a person searches for a book, it will use the key to tell the user whether the book is available or not, and many more wonderful things. For instance, before a book is returned, one must check if the book was borrowed at all from that linked list, if that linked list is empty, then no book was borrowed.
From the project of the library management system, doubly linked list seemed a good choice and that was what was implemented. The system works fine. Using the doubly linked list had a great advantage as insertions and deletions are very easy, searches are good and backward traversal is possible.
Browse our vast selection of original essay samples, each expertly formatted and styled