Closed allan-simon closed 9 years ago
Yeah, because of the whole ownership thing, storing a link back to a parent node requires reference-counting/weak pointers or raw pointers (and unsafety).
awesome, i'm gonna update my code today to switch from sequence_trie to radix trie
Let me know how that goes! :smile:
like it has been done in sequence trie
today i tried to implement them by adding a property "parent" (Option on a pointer of the parent trie node) to the TrieNode , so that the iterator would not need to keep a stack of the trie node he's traversing, but I didn't get it to compile (because of borrowed value being moved when setting the parent attribute )
Now that I think about it, the stack solution may not be that slower , and it will not need to add one more attribute for every single trienode.