SortedList
for (char i = 'A'; i <= 'Z'; i++)
{
sl.Add(i.ToString(), 0);
}
lends itself pretty well to getting a distribution (so that the integer is incremented with each occurrence of 'A', 'B', 'C' etc.)
In the 'olden days' (using C++) I'd probably have sorted a fixed array (26 of a char/int struct) - can you suggest a better way in C#?
Would received wisdom dictate using ICompareTo(), Sort or something?
Sam HobbsPosted Apr 9, 2010, 5:15 AM
Sam HobbsPosted Apr 9, 2010, 12:42 PM
TjPosted Apr 9, 2010, 8:10 AM
Yeah, I'd had a look at the IEnumerable interface in the Help File (but hadn't quite worked out how to use it - all that 'pseudo SQL').
Thanks again.