0% found this document useful (0 votes)
21 views3 pages

2.1. Book Management

This document outlines an assignment to create a library management system using binary search trees and linked lists. Students are asked to implement functions to load, insert, search, delete, and traverse data about books, readers, and lending items stored in these data structures. Books will be stored in a binary search tree using book codes as keys, while readers and lending items will be stored in linked lists. The program is meant to have a menu-driven interface to perform these operations and load/save data to files. Students must submit their source code, test files, and a run batch file in a compressed folder for assessment and demonstration of their work.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views3 pages

2.1. Book Management

This document outlines an assignment to create a library management system using binary search trees and linked lists. Students are asked to implement functions to load, insert, search, delete, and traverse data about books, readers, and lending items stored in these data structures. Books will be stored in a binary search tree using book codes as keys, while readers and lending items will be stored in linked lists. The program is meant to have a menu-driven interface to perform these operations and load/save data to files. Students must submit their source code, test files, and a run batch file in a compressed folder for assessment and demonstration of their work.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

DSA - Assignment 2

Library Management System


using Binary Search Tree data structure
INTRODUCTION
Your second assignment in this block will be using binary search tree data struture
for implementing a small Library Management System (LMS) in Java language.
LMS manages information about books, readers and book lending items. These
information are:
About a book:
1. bcode (string): the code of the book (this is the key of the tree and thus should be
unique).
2. title (string): the title of the book.
3. quantity (integer): the number of books with the same code the library has.
4. lended (integer): the number of books with the same code, which are still lended.
Condition: lended ≤ quantity.
5. price (double): The price of the book.

About a reader:

1. rcode (string): the code of the reader (this should be unique for the reader).
2. name (string): the name of the reader.
3. byear (integer): The birth year of the reader (must between 1900 and 2010).

About a lending:

1. bcode (string): the code of the book to be lended.


2. rcode (string): the code of the borrower.
3. state (integer): takes values 0, 1, or 2 only.

0: the book is not given to the reader


1: the book is still at the reader, not given back.
2: the book is given back to the library.

YOUR TASKS
You should use a binary search tree to store data for books and 2 linked lists, each one
is used to store data for readers or book lending items. You should create the data
structures from scratch, do not use structures available in java.
On running, your program displays the menu as below:

Books (8 marks) (using Binary Search Tree data structure, and bcode is the key of the
tree):
1.1. Load data from file
1.2. Input & insert data
1.3. In-order traverse
1.4. Breadth-first traverse
1.5. In-order traverse to file
1.6. Search by bcode
1.7. Delete by bcode by copying
1.8. Simply balancing
1.9. Count number of books

Reader list (1 mark) (using linked list):


2.1. Load data from file
2.2. Input & add to the end
2.3. Display data
2.4. Save reader list to file
2.5. Search by rcode
2.6. Delete by rcode

Lending list (1 mark) (using linked list:


3.1. Input data
3.2. Display lending data
3.3. Sort by bcode + rcode

Submission Requirements
Create the directory with a name like <class>-<name><roll number>-ASS1, e.g.
SE0508-QuangTV00456-AS2 (1)
The (1) directory contains the following files:

1. The run.bat file to run your program.


2. Your source code files.
3. Your input test files.

The statements in run.bat file may be:


cls
javac Main.java
java Main
pause
del *.class

Compress the folder (1) to .zip (or .rar) file (with the same name) and upload to cms.
Assignment assessment
You will be asked to modify immediately and to explain your assignment in lab room
to be sure that you are really the author of the assignment you submitted.

You might also like