Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing an entry from a MapPatriciaTrie #37

Open
Marlinski opened this issue Sep 10, 2020 · 2 comments
Open

removing an entry from a MapPatriciaTrie #37

Marlinski opened this issue Sep 10, 2020 · 2 comments

Comments

@Marlinski
Copy link

Hello,

is it possible to remove an entry from a MapPatriciaTrie ?

@takawitter
Copy link
Owner

There is no method for removing elements from Trie.
You still can implement remove function by treating null value as delete flag.

@Marlinski
Copy link
Author

Functionnally that would work but the key would still be stored inside the trie. This is a problem if the use case is one of "routing" (which is mine). At any given time I may have only up to N element, however elements comes and without the ability to remove keys, the structure will keep growing. Would be nice to have a feature to either remove a key or at least a "clean" method that would remove all the "null" elements from the trie and perform pruning optimization accordingly (I reckon this can be done manually by creating a new trie and adding only non-null elements).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants