Skip to content

Conversation

@RelativelyRandom
Copy link
Contributor

Remarks for List<T>.Sort incorrectly state that the method's worst-case time complexity is O(n2). This is probably a leftover from when it used just the basic quicksort.

Array.Sort is technically not wrong:

For arrays that are sorted by using the Heapsort and Quicksort algorithms, in the worst case, this method is an O(n log n) operation

However, since insertion sort is limited to small arrays and doesn't influence the big O, it is just as correct to simply state that the method is an O(n log n) operation.

@dotnet-bot dotnet-bot added this to the May 2020 milestone May 5, 2020
@dnfclas
Copy link

dnfclas commented May 5, 2020

CLA assistant check
All CLA requirements met.

@gewarren
Copy link
Contributor

@eiriktsarpalis @layomia Could you review this PR?

Copy link
Member

@eiriktsarpalis eiriktsarpalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks

@gewarren gewarren merged commit 4e7d674 into dotnet:master Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants