lander/trie
Jef Roosens 6a9603aa99
ci/woodpecker/push/docker Pipeline was successful Details
chore: move TRIE.md; disable auto deployment
2023-07-28 21:13:23 +02:00
..
include
src/trie
test
Makefile
README.md chore: move TRIE.md; disable auto deployment 2023-07-28 21:13:23 +02:00
config.mk

README.md

Trie design

The underlying data structure is based on a combination of a ternary and a Patricia trie.

  • Nodes are classic ternary trie nodes, meaning each node contains a binary search tree
  • Each node can define a skip, like a Patricia trie, of at most 8 characters. These skipped characters are stored directly in the structs defining the nodes.
  • While the add function relies on the fact that the input is a NULL-terminated C string, the trie itself does not store any NULL bytes.

The goal of this datastructure is to be as optimized as possible for search operations with short (usually < 8 characters) keys, as this is by far the most common operation for a URL shortener/pastebin.