Consistency
Xinok via Digitalmars-d
digitalmars-d at puremagic.com
Sun Feb 15 10:20:09 PST 2015
On Sunday, 15 February 2015 at 18:15:13 UTC, Meta wrote:
> On Sunday, 15 February 2015 at 17:18:08 UTC, Steve D wrote:
>> Python (built-in)
>>
>> dict1 = {"a":1,"b":2}
>> tup1 = (0,1,2,3)
>> arr1 = [0,1,2,3] # list type
>> str1 = "abcd"
>>
>> print "b" in dict1 # True
> O(1) lookup
A small nitpick, but I'm sure that should be O(log n).
Dictionaries don't have constant lookup time.
More information about the Digitalmars-d
mailing list