Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

S. For each situation given below (a-1). choose the appropriate data structure t

ID: 654606 • Letter: S

Question

S. For each situation given below (a-1). choose the appropriate data structure that we studied in Chapter 15 of the text book. (ArrayList, LinkedList, Queue. Stack, Set, Map). a) Data structure to keep track of different people's favorite color. b) Data structure to store a collection of properly spelled words. Each word will be unique. c) Data structure to store an ordered list of names, where we will want to add t remove names from anywhere in the list often. d) Data structure to enforce a first-in first-out ordering when elements are alit and removed, such as a line at the grocery store. e) Data structure to enforce a last-in first-out ordering. t) Would you use a HashSet or a TreeSet if you need to list the elements of set in order?

Explanation / Answer

a) Map

b) LinkedList

c)ArrayList

d)Stack

e)Queue

f)Set