[swift-users] Collection underestimatedCount() does _?

Jens Alfke jens at mooseyard.com
Mon Mar 21 14:04:20 CDT 2016

> On Mar 19, 2016, at 1:53 AM, Will Stanton via swift-users <swift-users at swift.org> wrote:
> Don’t most collections have O(1) `count` anyway?

No; linked lists and trees, which are pretty popular data structures, are generally O(n) to count.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160321/a5d46b5d/attachment.html>

More information about the swift-users mailing list