trienet icon indicating copy to clipboard operation
trienet copied to clipboard

Implement Update and Delete

Open nhaberl opened this issue 6 years ago • 4 comments

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 ?

nhaberl avatar Oct 24 '18 13:10 nhaberl

You are right. It is not implementeded yet. Updating the value should be easy. During deletion following conditions must considered.

  1. Key may not be there in trie. Delete operation should not modify trie.
  2. 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.
  3. Key is prefix key of another long key in trie. Unmark the leaf node.
  4. 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.

gmamaladze avatar Oct 30 '18 12:10 gmamaladze

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.

nhaberl avatar Oct 30 '18 18:10 nhaberl

Could you do that? I cannot find anybody who is able to do. :(

nhaberl avatar Nov 20 '18 17:11 nhaberl

Has progress been made on the update/delete implementations? Are they coming?

nicbavetta avatar Nov 26 '18 22:11 nicbavetta