计算机科学 > 程序设计语言
[提交于 2022年6月10日]
标题:Hinted Dictionaries: Efficient Functional Ordered Sets and Maps
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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.
提交历史
来自:Amir Shaikhha[v1] 2022年6月10日 星期五 00:00:00 UTC