This article introduces hinted dictionaries for expressing efficient ordered sets and maps functionally. As opposed to the traditional ordered dictionaries with logarithmic operations, hinted dictionaries can achieve better performance by using cursor-like objects referred to as hints. Hinted dictionaries unify the interfaces of imperative ordered dictionaries (e.g., C++ maps) and functional ones (e.g., Adams' sets). We show that such dictionaries can use sorted arrays, unbalanced trees, and balanced trees as their underlying representations. Throughout the article, we use Scala to present the different components of hinted dictionaries. We also provide a C++ implementation to evaluate the effectiveness of hinted dictionaries. Hinted dictionaries provide superior performance for set-set operations in comparison with the standard library of C++. Also, they show a competitive performance in comparison with the SciPy library for sparse vector operations.
翻译:本条引入了以功能方式表达高效定序数据集和地图的提示词典。 与使用对数操作的传统定序词典不同的是, 暗示词典可以通过使用光标类的字典( 指提示) 实现更好的性能。 提示词典可以将急需定序词典( 如, C++ 地图) 和功能词典( 例如, Adams 组) 的界面统一起来。 我们显示, 这些词典可以使用分类阵列、 不平衡的树木和平衡的树木作为基本表达方式。 在整个文章中, 我们使用 Scala 来展示暗示词典的不同组成部分。 我们还提供 C++ 执行来评价内缀词典的有效性。 封字典与 C+++ 的标准图书馆相比, 定置词典为定置操作提供了优异性功能。 此外, 与稀有病媒操作的 SciPy 库相比, 显示有竞争性性能 。