arrayscomplexityhashing
When a set is clearer than a list
Anonymous
If values only need membership checks, a set expresses that intent directly. A hash-based set has average O(1) lookup under typical hashing assumptions; a sorted array gives O(log n) lookup, with different update costs.
0