Does Linq.First() method return the first entry of a SortedDictionary in O(1) in C#?

Viewed 153

I know the Last() method of Linq returns the last entry of a SortedDictionary in O(n) because it needs to enumerate through all the entries. What about the First() method? Is it O(1) since it's enumerating only one iteration?

0 Answers
Related