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).
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.
Answer: A tree structure is the most common directory structure. B+ tree is best for keeping track of directories and files in a computer.
An array is the simplest and most widely used data structure. Other data structures like stacks and queues are derived from arrays.
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.
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).
You could look at Oracle Berkeley DB it provides the underlying key, data storage mechanism that you require or as already suggested sqlite.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With