I am sorting a Dictionary of 10,000 elements using the OrderBy method as shown below and want to know the big O of it. Does anyone know? After Ordering them I then add them to a new Dictionary in that order. There might be a better way of doing this, but it works for my purposes.
Here is my example:
m_sortedItems = new Dictionary<int,string>();
foreach(KeyValuePair<int,string> item in collection.OrderBy(key => key.Value)){
m_sortedItems.Add(item.Key, item.Value);
}
I checked on msdn but it wasn't listed: http://msdn.microsoft.com/en-us/library/bb534966.aspx