Data Retrieval/Insertion Data Structure

N

narasimha

Hello,

I have a data record with two fields...<value, date>. I have more
than a million of these records. As I add more records into this set,
I want a data structure that would be efficient enough to find
duplicate records with the same value, and earliest possible date. It
should be efficient to insert the records into the data structure. Is
there any database structure that I can get help with ??

-Narasimha
 
J

John Harrison

narasimha said:
Hello,

I have a data record with two fields...<value, date>. I have more
than a million of these records. As I add more records into this set,
I want a data structure that would be efficient enough to find
duplicate records with the same value, and earliest possible date. It
should be efficient to insert the records into the data structure. Is
there any database structure that I can get help with ??

The obvious structure would be std::map. But I think you are going to have
trouble fitting 1000000+ records into any data structure.

john
 
J

John Harrison

Gwar said:
std::multimap?

Possibly, I don't think its completely clear from the OP whether he ever
wants to store more than one date for a given value simultaneously.

If std::map or std::multimap is not suitable because of the size issues then
the OP should look at a BTree data structure.

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top