Just wondering what search time for set () is? O (1) or O (n)?
if i have
x = set () What is the lead time
if "a" is in x: print a in the set!
set is implemented using a hash, so searching on average is close to O (1). In the worst case, O (n), where n objects have oncoming hashes.
set