|
-
Apr 6th, 2006, 06:54 PM
#1
Thread Starter
No place like 127.0.0.1
[2005] Collection, ArrayList or Hashtable?
I am trying to decide which type of collection/array I should use for my current situation. I have a key (which would be an integer, but I don't mind storing it as a string) that is a numer (453278 lets say). And I need to find a corrosponding string (album name) for that number. I am basically trying to cross reference a number to an album name so I can find that number in another collection easily.
Here is what I have considered:
Array - Wouldn't work unless I did a 2-D array because I have 2 values I need to compare, and because the second dimension of the array would only be only have length of 0 which seems pointless. Also, I don't want to have to loop to find things
ArrayList - Might work because I can use IndexOf() to find things. But might not work because I would again have to do a 2-D array to find things. Making a structure wouldn't help because I could no longer use IndexOf since I would only know 1 of the peices of information (the number).
Collection - Would work because I have a key and a value, but seems too big for this problem.
HashTable - Don't know anything about them.
If I didn't explain this well enough please let me know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|