{ "q02": { "type": "single", "question": "\n\n\nSuppose you wanted your music player to keep track of whether or not you\nhave played a Taylor Swift song before. Which of the following would be\nthe most appropriate data structure to track this information?\n\n\n", "responses": { "map": "Map", "vector": "Vector", "set": "Set" } }, "q03": { "type": "single", "question": "\n\n\nSuppose you wanted your music player to keep of how many times you have\nplayed a Taylor Swift song. Which of the following would be the most\nappropriate data structure to track this information?\n\n\n", "responses": { "map": "Map", "vector": "Vector", "set": "Set" } }, "q01": { "type": "single", "question": "\n\n\nSuppose you wanted to build a music playlist so you can play all of your\nfavorite Taylor Swift songs in order. Which of the following would be the\nmost appropriate data structure to store your playlist?\n\n\n", "responses": { "map": "Map", "vector": "Vector", "set": "Set" } }, "q06": { "type": "multiple", "question": "\n\n\nWhich of the following statements are true regarding maps and sets in\nPython (select all that apply)?\n\n\n", "responses": { "sets_immutable": "Sets are immutable.", "dicts_key": "Dictionary keys can be any object including strings, ints, floats, and lists.", "sets_order": "Iterating over two sets with the same elements always yields the same order.", "sets_declaration": "A set can be declared with {item0, item1, ..., itemN}.", "dicts_declaration": "An empty dictionary can be delared with either dict() or {}." } }, "q04": { "type": "blank", "question": "\n\n\nComplete the has_duplicates Python function below, which returns\nTrue if the given list has any duplicates (otherwise\nFalse).\n\n\n\n
\ndef has_duplicates(lst):\n    return ____\n
\n" }, "q05": { "type": "multiple", "question": "\n\n\nWhich of the following statements are true regarding maps and sets in C++\n(select all that apply)?\n\n\n", "responses": { "unordered_sets_search": "Unordered sets have O(logn) average search times.", "ordered_sets_search": "Ordered sets have O(logn) average search times.", "sets_order": "An ordered set and unordered set with the same elements may iterate through a different sequence of elements.", "unordered_maps_hash": "Unordered maps utilize a hash table.", "ordered_maps_hash": "Ordered maps utilize a hash table." } } }