• duckythescientist@sh.itjust.works
    link
    fedilink
    arrow-up
    71
    ·
    2 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
      23
      ·
      1 day 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.

    • FizzyOrange@programming.dev
      link
      fedilink
      arrow-up
      9
      ·
      1 day ago

      Obscure 10 years ago maybe. These days there have been so many articles about them I bet they’re more widely known than more useful and standard things like prefix trees (aka tries).