Question: A librarian assigns a numeric code to all the books She maintains a key value pair to map the book name to the numeric code

A librarian assigns a numeric code to all the books
She maintains a key value pair to map the book name to the numeric code
Book shelves are marked with the numeric code
She follows a certain arrangement logic for storing her books
It is just that it is a digital library and the books are in the kindle format and the shelves are nothing but a certain space in her computer memory disk
When a customer requests a book, she searches for the book, retrieves the book from the digital shelf and issues the book to the customer
When a customer returns a book, she stores the book in the digital shelf
Design a data structure to search, store, retrieve books and use divide and conquer algorithm to implement that data structure.
Start the library with a fixed set of books. Get the book names from the input file and assign a code. Store the books in the digital library.
Simulate the issuance and return of books through another input file, where the input contains the time, book name, transaction code as I for Issuance and R for return of books.
Output file should contain
The representation of books along with their numeric codes at the start.
After every transaction, output the representation of books along with their numeric codes.
For the purpose of this assignment, assume that the book names are represented only by alphabets. Hint: Use ASCII code of alphabets
Read the input from a file input_1 and inputs_2.txt.
input_1.txt has the fixed format as mentioned below with each book names separated by a comma A,F,B,L,C,G,K,M
inputs_2.txt
10:00:00, I, C
10:30:00, R, H
11:00:00, I, L
11:30:00, R, C
Display the output in output.txt
You can write the output as comma separated values. for the above input the ouput is:
Shelf: 0,1,2,3,4,5,6,7
Book: A,B,C,F,G,K,L,M
Shelf: 0,1,2,3,4,5,6
Book: A,B,F,G,K,L,M
Shelf: 0,1,2,3,4,5,6,7
Book: A,B,F,G,H,K,L,M
Shelf: 0,1,2,3,4,5,6
Book: A,B,C,F,G,K,M

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!