Is checking if a value is present in a Python Set constant time?

后端 未结 0 796
南方客
南方客 2020-12-18 01:42

So I have read that Python\'s set is not like a list because it\'s actually based on hash tables. So if I check if a value is present is it constant time O(1) ?

Examp

相关标签:
回答
  • 消灭零回复
提交回复
热议问题