Question: 5 Databases You are working as a consultant for the company Boxes, Boxes and Boxes, that sells boxes. They want a database containing information

5 Databases You are working as a consultant for the company "Boxes, Boxes and Boxes", that sells boxes. They want a database containing information about all their boxes. Each box has an id, a size, a type, and a price. They want to be able to update the database with insertions and deletions of boxes. The database should support the following updates and queries efficiently: Insert(i, s, t, p): Insert a box with id i, size s, type t and price p into the database. Delete(i): Delete the box with id i from the database. Report-Price(a, b): Return the id of all boxes with a price between a and b. Find-Size(s): Return the id of the box with size closest to s. 5.1 Give a data structure supporting the required updates and queries. Analyse the space and the update and query times of your data structure. You may assume that the prices and sizes of the boxes are unique. 5.2 Change your solution to handle the case where the sizes and prices are not unique.
Step by Step Solution
3.51 Rating (151 Votes )
There are 3 Steps involved in it
Java program to design a data structure that support folloiwng operations in Thetan time a Insert b ... View full answer
Get step-by-step solutions from verified subject matter experts
