[swift-users] array.first vs. array[0]

David Turnbull dturnbull at gmail.com
Thu Jan 21 15:02:30 CST 2016


On Thu, Jan 21, 2016 at 12:23 PM, Dave Abrahams via swift-users <
swift-users at swift.org> wrote:

> Swift Dictionaries are documented as having O(1) lookup.
>

Only the lookup by index is O(1). Lookup by key is not specified. You can't
O(1) by key without a perfect hash function.

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


More information about the swift-users mailing list