DEV Community

[Comment from a deleted post]
Collapse
 
curtisfenner profile image
Curtis Fenner

Sets are usually analyzed as having O(log n) insert/delete (for a balanced tree based set) or O(1) (for a hash based set), not O(n) -- that would be the naive implementation of using a list as a set.