Question
Associative array with unsigned integers
Hello guys!
I have an associative array that is used in a special way: its keys are IDs as unsigned integers, but their order is random and some IDs are large numbers. That's why I have used an associative array. So, 2 questions:
1) Is this ok to use associative arrays this way? Because all I've read about associative arrays is that you usually use them with strings or objects, not int.
2) Is it fast to retrieve a value, given the key? Is it really hashed to be fast?
Thanks a lot!
Barbara
I have an associative array that is used in a special way: its keys are IDs as unsigned integers, but their order is random and some IDs are large numbers. That's why I have used an associative array. So, 2 questions:
1) Is this ok to use associative arrays this way? Because all I've read about associative arrays is that you usually use them with strings or objects, not int.
2) Is it fast to retrieve a value, given the key? Is it really hashed to be fast?
Thanks a lot!
Barbara