You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use your implementation for my data structure.
In particular set would behave like this:
s = set()
s.add(1)
s.add(2)
# Logarithmic search
one_present = 1 in s
# Only one 2 is present
s.add(2)
As you might notice, in this case, the insertion of an already existing Node would just override the existing one, not insert it somewhere else.
Do you think this is a useful addition and should I create a PR with that patch, or you're fine with the current implementation?
Cheers!
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion! The current implementation is intentionally a multi-set (i.e. it allows duplicate elements). Some of the examples in my algorithms class depend on that, so I'd like to keep it that way. However, if you want to add a second data-structure to the library that acts as a set, that would be totally welcome!
I want to use your implementation for my data structure.
In particular set would behave like this:
As you might notice, in this case, the insertion of an already existing Node would just override the existing one, not insert it somewhere else.
Do you think this is a useful addition and should I create a PR with that patch, or you're fine with the current implementation?
Cheers!
The text was updated successfully, but these errors were encountered: