I need an efficient data structure to store a list of integers. The amount in the list can vary from 1 to probably not more than 1000. The list will be requested approximately 20 times per request. What would be the most efficient type of collection to store?
UPDATE
To give a little more information, we'll take www.wikipediamaze.com (the little game I wrote) as an example (not a real scenario, but close enough for a conversation). For the list of puzzles on any given page, I am currently returning a list from the puzzle table connected to the table in which the puzzles that the current user played are stored. Instead, I want to cache a list of puzzles that are independent of the user. So what I'm doing is the first load and cache the list of puzzles from the database. Then I load and cache the list of puzzles that the user played. Then, when I repeat the puzzles to display them, I want to do this:
protected BestDataStructure<long> PlayedPuzzles {get; set;}
protected bool HasBeenPlayed(long puzzleId)
{
return PlayedPuzzles.Contains(puzzleId)
}
, , , .
!