Asymptotic complexity of .NET collection classes

MSDN Lists these: Dictionary<,> List<> SortedList<,> (edit: wrong link; here’s the generic version) SortedDictionary<,> etc. For example: The SortedList(TKey, TValue) generic class is a binary search tree with O(log n) retrieval, where n is the number of elements in the dictionary. In this, it is similar to the SortedDictionary(TKey, TValue) generic class. The two classes … Read more

How can I find a number which occurs an odd number of times in a SORTED array in O(n) time?

Theorem: Every deterministic algorithm for this problem probes Ω(log2 n) memory locations in the worst case. Proof (completely rewritten in a more formal style): Let k > 0 be an odd integer and let n = k2. We describe an adversary that forces (log2 (k + 1))2 = Ω(log2 n) probes. We call the maximal … Read more

tech