Question: You've joined the development team for a game called Autumn Dudes, in which players pilot a clumsy, unwieldy character through obstacle courses. Your team wants

You've joined the development team for a game called Autumn Dudes, in which players pilot a clumsy, unwieldy character through obstacle courses. Your team wants to add a weekly challenge: each player gets 1 attempt to navigate a specified obstacle course, and their time is saved. At the end of the week, you want to be able to tell every player their rank, where the player who had the fastest time is rank 1, the second fastest is rank 2, and so on. You also want to be able to display a leaderboard, which will list (in rank order) the usernames and corresponding times for everyone who partipates in the challenge. During the week, when a player completes the challenge, their completion time is stored as a (time, player) pair (where the time is the key) in a Priority Queue. This Priority Queue, then, must perform O(n) insertions throughout the week. At the end of the week, data is extracted from the Priority Queue and processed. The value with the minimum key is is repeatedly extracted from the queue and stored elsewhere for easy access. (a) What data structure should be used to implement the Priority Queue? Justify your answer. If you're stuck between two structures with identical asymptotic time com- plexities, choose the simpler structure. The data that is extracted from the Priority Queue is stored in two different structures: The first structure maps usernames (string values) to (rank, time) pairs. Users will want to be able to search for themselves and their friends by username and find their ranks and times; this structure should be able to quickly insert and search for string keys and their associated values. (b) What data structure should be used to map usernames to (rank, time) pairs? Justify your answer. The second structure maps ranks to (username, time) pairs, so players and their finish times can be searched by rank. (c) What data structure should be used to map ranks (non-negative integers bounded by the total number of players) to (username, time) pairs? Justify your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
