• duckythescientist@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    26 days ago

    I’m also not sure if this is obscure, but Bloom Filters! It’s a structure that you can add elements to then ask it if it has seen the element before with the answer being either “no” or “probably yes”. There’s a trade-off between confidence of a “probably yes”, how many elements you expect to add, and how big the Bloom Filter is, but it’s very space and time efficient. And it uses hash functions which always make for a fun time.

    • lad@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      25 days ago

      Relevant xkcd

      in Randall's words

      Sometimes, you can tell Bloom filters are the wrong tool for the job, but when they’re the right one you can never be sure.