I'm looking for the fastest solution to looking up an integer Value using a sorted integer array Key.
The Keys are integer arrays and have a fixed length of 3 and each array is sorted.
The Value is an integer.
My data guarantees that there are only EVER one OR two sorted arrays that have the same content. Each array has a unique index.
I'm trying to find the matching pairs of arrays.
My thought is to use a dictionary (I'm prototyping in C# and will move to C++)
For each array, I'll look in the dictionary and see if it's already there. If it is, I remove it from the dictionary. If I don't find it in the dictionary then it's either a singleton or it's the first of a matching pair so I'll add it to the dictionary.
My question is this - give then very specific guarantees on the data, what's the best container - given that speed is my primary concern? Also, any recommendations on appropriate (fast) hashing functions or compare functions for sorted integer arrays would be appreciated.