First, there is not need to use
ArrayList
since it was rendered obsolete by introducing of generics in .NET Framework 2.0. Use
System.Collections.Generic.List
. Now,
object.GetHashCode
is really needed to store data elements in hash-based containers:
System.Generic.Collections.Dictionary
,
System.Generic.Collections.SortedDictionary
,
System.Generic.Collections.SortedList
. The hash code for the Key type is important and should be written the way to provide "good" hashing properties helping to optimize the search speed in the collection.
The mechanism of such search and data structure is based on
backets, which is explained here:
http://en.wikipedia.org/wiki/Hash_table[
^].
—SA