Re:Accidentally quadratic: When Python is faster than C++
by mannerheim on Thursday March 04, 2021 @12:13PM
(#26345049)
Probably because the underlying implementation is a binary search tree which requires a comparison operator. Haskell likewise has Data.Set which requires an Ord instance. There's HashSet which requires a Hashable instance which can be automatically derived for any data type, so in principle you don't need ordering, but I would imagine in C++ you would have to provide your own hashing function from whatever data type you're trying to put in a hash set.
[ Parent
| on HN ]
There are no comments on this comment yet.