English 中文(简体)
C.C.++ 多功能图书馆
原标题:C/C++ MultiMap Library
  • 时间:2012-04-09 10:06:56
  •  标签:
  • c++
  • c

我储存了11 100万个高价值奶制品(一个钥匙可以具有多种价值——最高2/3),其关键是50个比特分类,价值为32个比值(最大)。 现在,我的要求是:

  1. Fast Insertion of (Key, Value) pair [allowing duplicates]
  2. Fast retrieving of value/values based on key.

是否有任何C/C++图书馆解决这一问题(利用多马普、B+树、B树、R+树等)。 ? 我可以为此提供5/6英镑的主要记忆。 欲了解更多信息:

最佳回答

因为“5.6吉比特”实际上是指5 OR 6 gigabytes......

111000000 带有50个轨道钥匙和32个轨道值的关键/数值计(11100 000 *(50+32))/(8*1024*1024=1.05千兆字节或记忆,储存在紧凑包装(比)阵列上。

那时,你们有5倍的记忆。

将在64个轨道系统上绘制10级深层次的速成图(11100 000 *(64+32+10*16)/(8*1024*1024)=3.308 在最坏的情况下,吉比特人以及你手里仍然有超过兆字节的援助团处理肥皂管理间接费用。

因此,我认为,你有足够的记忆处理你的情况,而不使用任何额外的trick计。

页: 1

实际上,我不知道C/C++。

如果你不了解C++,那么你会怎样用包含11 100 000个钥匙的地图? 你必须做一些读写。

标准图书馆包括:多图,增强图书馆内有几门课程。 Qt 4包括基于斯基普名单的QMap。 使用其中任何一种物品。

问题回答

你们的要求并不包括任何按命令收取的款项。 使用散射地图。 如果你能够找到一个已经准备好的人选,那不会给我们带来巨大的挑战。

A plain hashtable in C would take 50+32 (+14padding) + 32 +32 bits per element. (+ maybe 32 bit alignment). That is 160 (or 192) bits per element := 20 (or 24) bytes per element. The hash table would cost you 111* 20 (or 111*24) Mbytes of memory. That is 2.2 GB or 2.7GB.





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签