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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Sets are usually analyzed as having
O(log n)
insert/delete (for a balanced tree based set) orO(1)
(for a hash based set), notO(n)
-- that would be the naive implementation of using a list as a set.