Q1) You wanted to open a library, so you have bought N books and K racks (having N/K slots). All these books are currently just lying on the floor. Fortunately, you have the titles, ISBNs, and barcodes of the books on the bills you have received. You want to now arrange these books on the racks based on the book titles, just like words in the pages of a dictionary. However, sometimes, the titles of the books may match; you plan to use their ISBN for sorting in such cases. If ISBNs also match, you think of using their barcodes. Write a program to create the required data from the bills you have, sort the data as you have planned, and identify the appropriate slot for any book you pick from the floor for placing it as per the plan.
Q1) You wanted to open a library, so you have bought N books and K racks (having N/K
slots). All these books are currently just lying on the floor. Fortunately, you have the titles,
ISBNs, and barcodes of the books on the bills you have received. You want to now arrange
these books on the racks based on the book titles, just like words in the pages of a dictionary.
However, sometimes, the titles of the books may match; you plan to use their ISBN for
sorting in such cases. If ISBNs also match, you think of using their barcodes. Write a
program to create the required data from the bills you have, sort the data as you have planned,
and identify the appropriate slot for any book you pick from the floor for placing it as per the
plan.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images