再presenting稀疏整数集? [英] Representing sparse integer sets?

查看:113
本文介绍了再presenting稀疏整数集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是重新present稀疏整数集(真ç内存地址)在一个紧凑和快速的方式的一个很好的方式。我已经知道像位向量明显的事情,并运行长度编码。但我想要的东西远远超过每套元一个字更紧凑。我需要添加和删除元素,并测试成员。我并不需要另一套操作,如工会。

What is a good way to represent sparse set of integers (really C memory addresses) in a compact and fast way. I already know about the obvious things like bit-vectors and run-length encoding. but I want something much more compact than one word per set element. I need to add and remove elements and test for membership. I do not need other set operations, like union.

我读到这样一个图书馆多年以前,但已经忘记它的名字。我认为这是开放源码发行惠普和有一个女人的名字。

I read about one such library many years ago but have since forgotten its name. I think it was released as open source by HP and had a womans name.

推荐答案

您指的是一个朱迪阵列。这是一个惠普的项目。我认为他们在Ruby中使用,是在C语言中。非常有趣的数据结构。利用这一事实,即分配是(至少)字对齐的,具有用于密集和稀疏的范围分开的结构。

You are referring to a judy array. It was a HP project. I think they are used in ruby and are available in c. Very interesting data structure. Making use of the fact that allocations are (at least) word aligned, having separate structures for dense and sparse ranges.

http://judy.sourceforge.net/index.html

这篇关于再presenting稀疏整数集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆