我的问题如下:
给定一个三元组列表,它们存储在一个名为 hash_heap 的数据结构中(我不确定名称,只是表示它应该是哈希表和堆的混合体)。我希望数据结构提供以下方法,
index_by_first_col(key) // the method could help find the a triple stored in it by matching the first column. It expects the searching is running at constant time
get_min_by_third_col() // the method get the minimum triple sort according to the third column, it is also expects the method is running at constant time.
insert_new_elt(triple) // add new trip, running at constant time
是否可以实现一些这样的数据结构?我知道 hashtable 可以支持第一种方法,而 heap 可以支持第二种和第三种方法,但我不知道如何将它们混合在一起。有任何想法吗?
谢谢!