Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started