Best Data Structure

Data insertion is for 1 hour, could be 1MB to 100GB, sorted either ascended or decended, let's say every alternate day. Fast retriveal is required 24/7.

I am confused which one to use BST, AVL. Heaps and Arrays.
Anyone have something to say on this?

Many thanx.
There is no best. There is the one who better fits on your needs. Anyway, I'd highly recommend STL containers instead of implement by yourself, which is a waste of time these days.
I'd highly recommend STL containers instead of implement by yourself, which is a waste of time these days.


Sure when the STL has the data structure you need, you should probably use it, but the STL doesn't have everything, pretty much just the bare minimum.

It didn't even have hash tables or hash maps until very recently and those are a few of the most useful data structures of all.

In many C++ applications you need to implement your own custom data structures. Especially when it comes to graphs / networks where you need a lot of special rules and requirements.

Then you have quad trees, and other various other tree variants, and the list can go on.

And for different categories of data structures, there are also different ways to implement them which have trade offs. The STL doesn't even guarantee the implementation, let alone have multiple options, so you cannot choose AVL tree or B tree or Red and Black tree. If your program needs to do what the OP described, then you probably should not use an STL container because you want to be sure to use the variant with the best performance for your application. You might go looking for other libraries, or implement yourself if it's important enough and you are good enough.
Last edited on
> Data insertion is for 1 hour, could be 1MB to 100GB

Hmm... up to 100GB every alternate day?
We are certainly not talking about in-memory data structures here, are we?

It would probably be best to implement the retrieval algorithms atop a massively scalable, high performance database. Something like Hypertable http://hypertable.com/home/
Correction it's 10GB max..... Alternate day is based on averagve influx.........

revising my question .......... what is the best data structures in terms of storing and fast retrival if we have to opt only one?????




> what is the best data structures in terms of storing and fast retrival if we have to opt only one?????

Need a lot more information before one can even make an attempt at a suggestion.
Topic archived. No new replies allowed.