4 ms·
C++ 'sets' are ordered mutable binary search trees in most implementations. Not the ties and hashtables of other languages. With strict weak ordering, you rea
by nyrikki 3y ago
C++ 'sets' are ordered mutable binary search trees in most implementations.
Not the ties and hashtables of other languages.
With strict weak ordering, you really only have the ordering of to elements.
Ada took care of that polysemy between ordered and hash sets a long time ago.
But ya it took them to long to implement 'contains', but JavaScript requiring ordered sets while allowing multiple implementation details complicated it IMHO. Had they chosen a structure vs a time complexity it would have been easier to extend.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...