Question: Suppose you are asked to design a data structure for hosting information of a set of open-source software project contributors. Each contributor has a
Suppose you are asked to design a data structure for hosting information of a set of open-source software project contributors. Each contributor has a set of attributes, including user-id (unique), user name, and a numeric score indicating the contributor's experience (100, 110, etc.) The data structure should be able to support highly efficient search and edit by user id. For instance, we would like to modify a user's score or its user name. The data structure should also support a highly efficient search by score. For instance, quickly return users with a score within [100,200]. Answer the following two questions: 1. how would you design such a data structure? Briefly explain your design concerns. Sub-optimal design won't get full marks. 2. what is the time complexity (big-O) of your designed data structure for getting the user names having a score within [n, m]? Briefly explain how you get the big-O result.
Step by Step Solution
3.55 Rating (155 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
