algorithm - what is the most memory efficient datastructure for maintaining a sordted <5k list of integers? -


i have many lists of sorted integers, of them less 3600 items each. i'd keep them in memory as possible, i'm looking space efficient datastructure.

most common operations inserts, membership testing , range queries.

the integers in 1 through 10 billion-range, though in theory there corner cases integers lower.

i've been looking @ skiplists, quite nice, feel there might more efficient structures out there.

this depends on access pattern , proportion of lookups respect modifications. when lookups more common modifications (in case, inserts apparently), quite common, can away sorted arrays give optimal memory efficiency.

if inserts more common, sorted arrays won't do, , have resort more complicated data structures. b-trees sound possible candidate given pack many nodes together, , not suffer linkage overhead as avls, skip-lists or red-black trees.

i think interesting investigate radix trees, if there happens lot of successive integers in lists, because such ranges "compressed" radix tree.

it worth noting bloom filter can further optimize membership queries. are, in way, space-efficient data structures membership queries, being probabilistic, can use them in combination other deterministic data structure, unless of course allowed return incorrect answers :-).


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -