Question: Design the data structure for implementing an ADT called ITEM-SET, with the following specifications: Items: A collection of objects with the following attributes: i.name :

 Design the data structure for implementing an ADT called ITEM-SET, with

Design the data structure for implementing an ADT called ITEM-SET, with the following specifications: Items: A collection of objects with the following attributes: i.name : a unique string i.cost: a unique decimal value such as 22.99 i.rating: a unique decimal value between 0.0 and 5.0, e.g., 0.012, 3.1415926. i.e. no two items have the same name/cost/rating value. Operations: get_item(R, name) : returns the item with name name if it exists in the ITEM-SET R; returns None if the item does not exist in R. add_item(R, item) : Add a item item to the ITEM-SET R. The added item has unique name, cost and rating avg_cost(R, ri, r2), r1 r2: consider all items with rating r that r1

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!