Skip to content

Commit 2bac253

Browse files
authored
Merge pull request #145 from vaibhavsagar/patch-1
Update documented time complexity.
2 parents cecfe9b + befdf31 commit 2bac253

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Data/HashSet.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,20 +226,20 @@ size :: HashSet a -> Int
226226
size = H.size . asMap
227227
{-# INLINE size #-}
228228

229-
-- | /O(min(n,W))/ Return 'True' if the given value is present in this
229+
-- | /O(log n)/ Return 'True' if the given value is present in this
230230
-- set, 'False' otherwise.
231231
member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
232232
member a s = case H.lookup a (asMap s) of
233233
Just _ -> True
234234
_ -> False
235235
{-# INLINABLE member #-}
236236

237-
-- | /O(min(n,W))/ Add the specified value to this set.
237+
-- | /O(log n)/ Add the specified value to this set.
238238
insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
239239
insert a = HashSet . H.insert a () . asMap
240240
{-# INLINABLE insert #-}
241241

242-
-- | /O(min(n,W))/ Remove the specified value from this set if
242+
-- | /O(log n)/ Remove the specified value from this set if
243243
-- present.
244244
delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
245245
delete a = HashSet . H.delete a . asMap

0 commit comments

Comments
 (0)