Which data structure in Python is best for fast membership checks?
Correct answer
B. set
6 views
B. set
6 views
Sets use hash tables, giving average O(1) membership testing.
Asked in: Python Interview Lists
https://docs.python.org/3/tutorial/datastructures.htmlNot sure why the answer is B? Ask here and get an explanation.