[pydotorg-www] Edit Permission?
Robert DiPietro
rdipietro at gmail.com
Sun May 17 12:54:39 EDT 2020
Hi all,
Thank you for maintaining these pages. The TimeComplexity page (
https://wiki.python.org/moin/TimeComplexity) has been especially helpful to
me over time.
I signed up to make an edit to this page, by adding the following row to
the top of the *dict* table:
Operation Average Case Amortized Worst Case
x in d O(1) O(n)
Small aside 1: I do realize that the reader can potentially figure this out
from this page. But to do this, the reader needs to scroll up to the
seemingly distinct *set* table, to catch the statement "See dict -- the
implementation is intentionally very similar." And even then the reader is
left wondering if x in d is actually constant on average.
Small aside 2: I have not looked at the underlying dict code, but I did
empirically verify that x in d is indeed constant on average. I assume that
it's based on hashing, which then would also imply the same
amortized-worst-case complexity as set.
My wiki name is RobertDiPietro
Cheers!
Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pydotorg-www/attachments/20200517/2f588931/attachment.html>
More information about the pydotorg-www
mailing list