I have a trie
which I am using to do some string processing. I have a simple compiler which generates trie
from some data. Once generated, my trie
won't change at run time.
I am looking for an approach where I can persist the trie in a file and load it effectively. I have looked at sqllite
to understand how they are persisting b-tree
but their file format looks bit advanced and I may not need all of those.
It'd be helpful if someone can provide some ideas to persist and read the trie
. I am programming using C.
I did some research and found the following little gems online:
trie.h
trie.c
A working trie with serialization and deserialization. It was originally written for use in Python (there's a corresponding triemodule.c
for tying it to Python), but it's pure C; you could mine it for ideas or use it as you wish.
Update:
It appears the links are no longer working. I'll keep the originals up, but here are the links in the wayback machine:
trie.h
trie.c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With