I have a SortedList, where int is the key and value is a string.
public void AddElements() { int collectionLength = Int32.Parse(Console.ReadLine()); for(int key = 0; key < collectionLength; key++) internalSortedList.Add(key, RandomClass.CreateRandomString()); } The question is how to set a key as GetHashCode?
GetHashCodefrom what? You can writekey.GetHashCode(), but it will not make sense, because The hash code fromintis theintvalue itself, but you can do something in the spirit ofString value = RandomClass.CreateRandomString(); internalSortedList.Add(value.GetHashCode(), value);String value = RandomClass.CreateRandomString(); internalSortedList.Add(value.GetHashCode(), value);- StateItPrimitive pm