Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any good known file based key->value datastructure available in c++?

Is there any good file based key->value data-structure available in c++.

similar to std::map(template based) with a insert/delete/get of O(logn).

like image 690
aeh Avatar asked Sep 10 '10 09:09

aeh


People also ask

Which data structure is used to map keys to values?

In computing, a hash table, also known as hash map, is a data structure that implements an associative array or dictionary. It is an abstract data type that maps keys to values.

Which data structure is best for file directory?

Answer: A tree structure is the most common directory structure. B+ tree is best for keeping track of directories and files in a computer.

Which is the most useful data structure?

An array is the simplest and most widely used data structure. Other data structures like stacks and queues are derived from arrays.

Is C good for data structures?

Data Structures in C are used to store data in an organised and efficient manner. The C Programming language has many data structures like an array, stack, queue, linked list, tree, etc. A programmer selects an appropriate data structure and uses it according to their convenience.


2 Answers

STXXL - Standard Template Library for XXL Data Sets implements file-based containers.

It's stxxl::map is quite similar to std::map, based on B+ tree with an insert/delete/get of O(logn).

like image 163
Lior Kogan Avatar answered Oct 18 '22 08:10

Lior Kogan


You could look at Oracle Berkeley DB it provides the underlying key, data storage mechanism that you require or as already suggested sqlite.

like image 1
Jackson Avatar answered Oct 18 '22 08:10

Jackson