最有效的存储1024 * 1024位的方式 [英] Most efficient way of storing 1024*1024 bits

查看:216
本文介绍了最有效的存储1024 * 1024位的方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我需要一种时间和空间有效的方式来存储多达600万位。时间

效率比空间效率更重要因为我要通过钻头进行搜索




关于tores

Hi

I need a time and space efficient way of storing up to 6 million bits. Time
efficency is more important then space efficency as I''m going to do searches
through the bit-set.

regards tores

推荐答案

C?


Tor Erik S?nvisen写道:
C ?

Tor Erik S?nvisen wrote:


我需要一种时间和空间有效的方式来存储多达600万位。时间效率比空间效率更重要,因为我将通过位集进行搜索。

关于tores
Hi

I need a time and space efficient way of storing up to 6 million bits. Time
efficency is more important then space efficency as I''m going to do searches
through the bit-set.

regards tores






" Tor Erik S?nvisen" <到*** @ stud.cs.uit.no>写道:
"Tor Erik S?nvisen" <to***@stud.cs.uit.no> writes:
我需要一种时间和空间有效的方式来存储多达600万位。时间效率比空间效率更重要,因为我要通过位设置进行搜索。
I need a time and space efficient way of storing up to 6 million bits. Time
efficency is more important then space efficency as I''m going to do searches
through the bit-set.




嗯,什么你想做什么样的搜索?对于速度你想要什么,你可以使用内置函数,string.find和那种

的东西。因此,请相应地选择数据格式。



Umm, what kind of searches do you want to do? For speed you want to
use built-in functions wherever you can, string.find and that kind of
thing. So choose your data format accordingly.


" Tor Erik S?nvisen" <到*** @ stud.cs.uit.no>写道:
"Tor Erik S?nvisen" <to***@stud.cs.uit.no> writes:
我需要一种时间和空间有效的方式来存储多达600万位。时间效率比空间效率更重要,因为我将通过位集进行搜索。
I need a time and space efficient way of storing up to 6 million bits. Time
efficency is more important then space efficency as I''m going to do searches
through the bit-set.




六兆字节是在现代计算机上几乎没有任何东西。我会将这些东西存储为0字符串。和1,然后使用.find(或者可能是

in关键字)进行搜索。


这不起作用好吧,如果你要改变字符串,

虽然。


< mike

-

Mike Meyer< mw*@mired.org> http://www.mired.org/home/mwm/

独立的WWW / Perforce / FreeBSD / Unix顾问,电子邮件以获取更多信息。



Six megabytes is pretty much nothing on a modern computer. I''d store
the things as a string of "0" and "1", and then use .find (or maybe
the in keyword) for doing the searches.

This doesn''t work very well if you''re going to mutate the string,
though.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.


这篇关于最有效的存储1024 * 1024位的方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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