はい、ロッシーハッシュテーブルまたはLRUCacheは、偽陰性のみを返す高速O(1)ルックアップを持つデータ構造です。「テストXを実行しましたか?」と尋ねると、はい、あなたは間違いなく "、または"私は覚えていません "。このタスクを達成する正確なデータ構造がDirect-mapped cacheであり、そして一般のCPUで使用される
setup_test_table():
create test_table(some large number of entries)
clear each entry(test_table, NEVER)
return test_table
has_test_been_run_before(new_test_details, test_table):
index = hash(test_details , test_table.length)
old_details = test_table[index].detail
// unconditionally overwrite old details with new details, LRU fashion.
// perhaps some other collision resolution technique might be better.
test_table[index].details = new_test_details
if (old_details === test_details) return YES
else if (old_details === NEVER) return NEVER
else return PERHAPS
main()
test_table = setup_test_table();
loop
test_details = generate_random_test()
status = has_test_been_run_before(test_details, test_table)
case status of
YES: do nothing;
NEVER: run test (test_details);
PERHAPS: if(rand()&1) run test (test_details);
next loop
end.
http://cstheory.stackexchange.com/questions/6596/a-probabilistic-set-with-no-false-positives –
完全を期すため、これは興味深いことがあります。https://github.com/ jmhodges/oppos_of_a_bloom_filter – Dave
「ブルームフィルタの反対」という面白い名前のものが1つあります。コード:https://github.com/jmhodges/opposite_of_a_bloom_filter ブログ:http://www.somethingsimilar.com/2012/05/21/the-opposite-of-a-bloom-filter/ – ib84