Login
You're viewing the code4lib.social public feed.
  • Sep 8, 2026, 8:30 AM

    If your keys are simple arrays, a trie is probably a good option because it avoids the usual inefficiency of a sorted tree for complex keys. When keys are more than that, it starts getting tricky

    Also, footnote to the first point in the first thread above: obviously hash/random ordering is okay if you’re sure the nondeterminism will never affect the program’s output, but my own experience is that such cases are actually quite rare

    💬 2🔄 0⭐ 0

Replies

  • 💬 1🔄 0⭐ 0
  • Sep 8, 2026, 9:15 AM

    @wingo I think there is probably something not entirely terrible lurking behind the idea of marrying a radix tree to an RRB tree, an excellent idea for someone else to try out

    It still just doesn’t feel elegant, but maybe I am mistaking elegance for novelty

    💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • Sep 8, 2026, 6:30 PM

    @janl @dpk @wingo

    i've been playing with radix tries, lock free hashtables, and history independent persistent treaps

    like split ordered lists github.com/tef/sink a lock free hash table built over a linked list

    and ziptrees. which is another name for a treap built using a split/merge operation

    codeberg.org/tef/ziptree

    i've built maps, sets, lists, and ropes using them, and the fun part is that i used zippers for all of them

    as much as i love radix tries, ziptries are my new fav

    💬 1🔄 0⭐ 0
  • Sep 8, 2026, 6:38 PM

    @janl @dpk @wingo

    on radix tries: you can transform any normal binary tree into one capable of prefix search

    for each node, you store longest-common-prefix with the closest left and right ancestor, and this allows you to avoid rechecking shared prefixes when searching the tree

    for a treap, it looks like this:

    codeberg.org/tef/ziptrie

    it's not as fast as a radix trie, but you do get fast set operations, like union, intersect, difference

    and you can implement them with zippers!

    💬 1🔄 0⭐ 0
  • Sep 8, 2026, 6:40 PM

    @janl @dpk @wingo this is some real "you do not have to understand this" code, so my apologies in advance

    and uh it also contains original work, as the paper only covers top down insert and delete, and my code introduces ways to merge two treaps bottom up

    the paper authors thought it was neat, at least!

    💬 0🔄 0⭐ 0