Skip to content
/ ctrie Public

High performance, low memory consumption compact trie data structure written in C.

License

Notifications You must be signed in to change notification settings

dcepelik/ctrie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ctrie

High performance, low memory consumption compact trie data structure written in C.

DESCRIPTION

A compact trie is a trie where each node which is the only child is merged with its parent. This allows for substantial memory savings compared to the naive trie implementation, while preserving decent speed.

This implementation further saves space by directly embedding short labels in the trie nodes whenever possible, saving heap allocations and the associated overhead of accounting data (i.e. pointers to strings) which need to be kept.

The code is clean and well tested.

FEATURES

  • Fast insertion and lookup (O(k) where k is the length of the key in bytes)
  • Well tested
  • Wildcard support

Wildcards

It's possible to insert prefix nodes. For example, you may insert a foobar* node, which will be returned upon looking for any key starting with foobar, e.g. foobar or foobarbaz.

AUTHORS

  • David Čepelík
  • Ondřej Hrubý

LICENSE

MIT

About

High performance, low memory consumption compact trie data structure written in C.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published