I think the idea you have been given is just fine for your original problem. But if you want to do other things as well, as you now indicate, you should still stick with the hash. The point is what the hash contains. Each hash value can be a pointer to an array. This is frequently referred to as a "Hash of Arrays" or HoA. That way, you can keep as many statistics as you want in the array, with one array for each hash key. There's plenty of documentation on this data structure.
Regards,
John Davies
| [reply] |