sestoft / C5

C5 generic collection library for C#/.NET
http://www.itu.dk/research/c5/
MIT License
1.03k stars 180 forks source link

Time complexity of SortedArray<t> indexing #65

Closed mikernet closed 5 years ago

mikernet commented 6 years ago

Reading through the documentation and O(log n) performance for doing this[i] on a sorted array doesn't seem right. Shouldn't indexed access to an array be O(1)?

sestoft commented 6 years ago

Indeed this should be O(1).

Peter

On 10Nov17, 21:37, "Mike Marynowski" notifications@github.com<mailto:notifications@github.com> wrote:

Reading through the documentation and O(log n) performance for doing this[i] on a sorted array doesn't seem right. Shouldn't indexed access to an array be O(1)?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/sestoft/C5/issues/65, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAsoELfuDW3V_7a8nbYiumchRpfIu14Uks5s1LP5gaJpZM4QaE-8.