Abstract Data Types

Choose the best abstract data type (List, Set, Map, PQ, Queue, Stack) given the description of the desired data structures below. Be as specific as possible (don’t answer List if a Queue is applicable). Also show what types would be used as template arguments (e.g. map<string, int> or stack<double>). If multiple “best” options exist, choose either. Give a SHORT 1–2 sentence justification for your choice (don’t waste time on a long explanation…it won’t help you get any more credit than a short answer).


1.1

A structure to support the following: an academic advisor wants to track the students she advises each day over the course of a semester. Given a day, she’d like to quickly check if she advised a particular student and also be able to quickly go from one day’s students to the next or previous day’s students.


1.2

A structure for storing the percentage of people vaccinated in each US state (and quickly be able to update that percentage).


1.3

A structure to store the answers on a website like StackOverflow.com. The answers should be displayed in order of “upvotes” from highest number of upvotes to least.


1.4

A structure to track who is in each checkout/cashier lane and their order for an entire grocery store where customers may choose a checkout line (given by an integer) to then wait in.