For each of the following data storage needs, describe which abstract data types you would suggest using. Natural choices would include list, set, map, but also any simpler data types (string, int, double) that you may have learned about before.
Try to be specific, e.g., rather than just saying "a list", say "a list of integers" or "a list of names (strings) and a GPA (double)". If you specify a map please describe what the key and value will be. Also, please give a brief explanation for your choice: we are grading you at least as much on your justification as on the correctness of the answer. Also, if you give a wrong answer when you include an explanation, we'll know whether it was a minor error or a major one, and can give you appropriate partial credit. Also, there may be multiple equally good options, so your justification may get you full credit.
a. a data type that allows quick retrieval of the name of a song given the name of a playlist (or album) and the track number
b. a data type to store the text of the steps of a recipe for how to bake a cake
c. a data type that associates a file extension with the possible programs that are able to read/open that kind of file
d. a data type that stores all the TV station identifications (e.g. KABC, KNBC, etc.)

Respuesta :

Answer:

Explanation:

1. data type which allows quick retrieval of the name of a song given the name of a playlist(or album) and the track number would be :

map

It can be defined as a key-value pair where combination of playlist-track number would be the the key and song name/details would be the value for that corresponding key

2. data type to store the text of the steps of a recipe for how to bake a cake would be :

list

list of string datatype can be used : each item in the list will have recipe in the data part of the node

3. data type for storing file extension with the possible programs that are able to read/open that kind of file wold be

set

It can be defined as a key-value pair where file extension would be the the key and possible program list would be the value for that corresponding key

4. data type that stores all the TV station identifications (e.g. KABC, KNBC, etc..) would be :

map

as there is no duplication in the names of TV station so map with key/value pair of TV station name /details would be appropriate to be used