in reply to What data structure must I use for this problem?

Hmm, not so sure about a database. When duplicate entries are allowed, database very often perform relatively poorly. And, more broadly, a hash is vastly faster than a database, so that a database gains an advantage only when the data is so big that it does not fit into a hash.

In brief, an hash of arrays really seems to be what you need.

  • Comment on Re: What data structure must I use for this problem?

Replies are listed 'Best First'.
Re^2: What data structure must I use for this problem?
by Anonymous Monk on Jun 24, 2014 at 23:30 UTC
    Ah, that's great!
    Thank you Monks!