سؤال

See http://en.wikipedia.org/wiki/Quotient_filter . I did not find a single implementation yet, and I'd like something to play with, the Wikipedia explanation is a little dry for my taste.

هل كانت مفيدة؟

المحلول

I implemented a quotient filter in C (link). It supports the following operations;

  • Insert(qf, key)
  • May-Contain(qf, key)
  • Remove(qf, key) (with a caveat, see the documentation in qf.h)
  • Merge(qf1, qf2) -> qfout
  • Iterate(qf)

The repository contains some documentation and a fairly rigorous test suite.

نصائح أخرى

I implemented one in PHP for the purpose of playing around with it. It's not complete but add/contains is implemented. This is not fool proof or even bug proof.

https://github.com/dsx724/php-quotient-filter

Hope this helps.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top