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

Value-less trie #11

Open
b4hand opened this issue Jun 30, 2014 · 1 comment
Open

Value-less trie #11

b4hand opened this issue Jun 30, 2014 · 1 comment

Comments

@b4hand
Copy link
Contributor

b4hand commented Jun 30, 2014

It would be nice to be able to support a pure trie that has no additional value besides the key itself.

This change seems like it would be a bit invasive, and I'm not sure how to achieve it without inducing some code duplication, but I was curious if you had any strong objections to this feature?

@dcjones
Copy link
Owner

dcjones commented Jul 1, 2014

If you're keeping a set of many string, then there's clearly an advantage to a hat-trie version that saves 4-8 bytes per entry by not keeping a value. Since the goal is to create a highly optimized structure for strings, adding a set variant makes sense.

It would be a slightly messy, but I think it could be done by adding a flag to hattrie_t and ahtable_t that determines wether a value should be stored, adding a few conditions to ahtable_t and making a thin hattrie_set_... API.

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