Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language is based on python 3. [total: 12] In this problem, you will design the data structure for implementing an ADT called RESTAURANT-SET. Below is

image text in transcribedLanguage is based on python

3. [total: 12] In this problem, you will design the data structure for implementing an ADT called RESTAURANT-SET. Below is the description of the ADT. Objects: A collection of restaurants in the same city. Each restaurant has the following attributes: restaurant.name: a string which is the name of the restaurant. Each restaurant has a unique name, i.e., no two restaurants have the same name. restaurant.cost: a decimal value such as 22.99 that denotes the cost of a 1 person meal at the restaurant. For simplicity, assume that each restaurant's cost is unique, i.e., no two restaurants have the same cost. restaurant.rating: a decimal value between 0.0 and 5.0, e.g., 0.012, 3.1415926. For simplicity, assume that each restaurant's rating value is unique, i.e., no two restaurants have the same rating value. Operations: GET-RESTAURANT (R, name): returns the restaurant with name name if it exists in the RESTAURANT-SET R; returns NIL if the restaurant does not exist in R. ADD-RESTAURANT (R, restaurant): Add a restaurant restaurant to the RESTAURANT-SE R. You may assume that restaurant has a unique name, a unique cost and a unique rating. AVG-COST(R, ri, r2), r1 3 and

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions