dotnet / dotnet/dotnet-api-docs
Question about Time Complexity
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
@EngineerSpock commented on [Tue Dec 04 2018](https://github.com/dotnet/dotnet-api-docs.ru-ru/issues/4)
It seems that the time complexity of Clear in the SortedSet is O(1) as well as in case of the SortedDictionary while documentation says it is linear. I found the following code of the Clear method in the SortedSet:
public virtual void Clear() {
root = null;
count = 0;
++version;
}
---
#### Сведения о документе
⚠ *Не вносите правки в этот раздел. Это необходимо для связывания страницы сайта docs.microsoft.com с вопросом на GitHub.*
* ID: b4c066df-fd39-5f78-bd28-dd74ec6daf7d
* Version Independent ID: e2e77322-dde1-bcf7-03d6-5017f0b28819
* Content: [SortedSet<T>.Clear Method (System.Collections.Generic)](https://docs.microsoft.com/ru-ru/dotnet/api/system.collections.generic.sortedset-1.clear?view=netframework-4.7.2)
* Content Source: [xml/System.Collections.Generic/SortedSet`1.xml](https://github.com/dotnet/dotnet-api-docs.ru-ru/blob/live/xml/System.Collections.Generic/SortedSet`1.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**
Contributor guide
Assessment
This issue has not been assessed yet.