How does the HyperLogLog algorithm work?
I've been learning about different algorithms in my spare time recently, and one that I came across which appears to be very interesting is called the HyperLogLog algorithm - which estimates how many unique items are in a list. This was particularly interesting to me because it brought me back to my MySQL days when I saw that "Cardinality" value (which I always assumed until recently that it was calculated not estimated). So I know how to write an algorithm in O ( n ) that will calculate how many unique items are in an array. I wrote this in JavaScript: function countUniqueAlgo1(arr) { var