Data structure for efficiently returning the top-K entries of a hash table (map, dictionary)
- 阅读更多 关于 Data structure for efficiently returning the top-K entries of a hash table (map, dictionary)
问题 Here's a description: It operates like a regular map with get , put , and remove methods, but has a getTopKEntries(int k) method to get the top-K elements, sorted by the key: For my specific use case, I'm adding, removing, and adjusting a lot of values in the structure, but at any one time there's approximately 500-1000 elements; I want to return the entries for the top 10 keys efficiently. I call the put and remove methods many times. I call the getTopKEntries method. I call the put and