trienet
trienet copied to clipboard
Implement Update and Delete
Hi,
is it possible to update the value T on a word when it is already stored ? As it seems now I have to destroy the the whole Trie structure and rebuild it ?
You are right. It is not implementeded yet. Updating the value should be easy. During deletion following conditions must considered.
- Key may not be there in trie. Delete operation should not modify trie.
- Key present as unique key (no part of key contains another key (prefix), nor the key itself is prefix of another key in trie). Delete all the nodes.
- Key is prefix key of another long key in trie. Unmark the leaf node.
- Key present in trie, having atleast one other key as prefix key. Delete nodes from end of key until first leaf node of longest prefix key. Feel free to fork and merge request.
Thanks a lot, I am not that expert so if you have further information I will check if anybody else can do that. In the end it has to be deleted and added again as I understand 13:26, 30. Oktober 2018, George Mamaladze [email protected]:You are right. It is not implementeded yet. Updating the value should be easy. During deletion following conditions must considered.
Key may not be there in trie. Delete operation should not modify trie. Key present as unique key (no part of key contains another key (prefix), nor the key itself is prefix of another key in trie). Delete all the nodes. Key is prefix key of another long key in trie. Unmark the leaf node. Key present in trie, having atleast one other key as prefix key. Delete nodes from end of key until first leaf node of longest prefix key. Feel free to fork and merge request.
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.
Could you do that? I cannot find anybody who is able to do. :(
Has progress been made on the update/delete implementations? Are they coming?