Object-Oriented Programming · Atlassian · Medium
Requirements Build a data structure that supports these operations: increasePopularity raises the specified content item's score by one. decreasePopularity lowers that score by one. getMostPopular returns a content ID whose current score is greatest. Discuss how to make every operation run in O(1) time. Explain how your implementation behaves when several content IDs share the maximum score. One tie-breaking option is to return the content ID that first reached the maximum…
Checking your access…