2
65kviews
Explain Flajolet Martin Algorithm with example.
written 5.1 years ago by | modified 2.5 years ago by |
ADD COMMENT
EDIT
2 Answers
written 5.1 years ago by | modified 2.5 years ago by |
written 5.1 years ago by |
Flajolet-Martin algorithm approximates the number of unique objects in a stream or a database in one pass. If the stream contains n elements with m of them unique, this algorithm runs in $O(n)$ time and needs $O(log(m))$ memory.
Algorithm:
Create a bit vector (bit array) of sufficient length L, …
written 5.1 years ago by |
We may want to know how many different elements have appeared in the stream.
For example, we wish to know how many distinct users visited the website till now or in last 2 hours.
If no of distinct elements required to process many streams then keeping data in main memory …
Thanks for excellent explanation. But I have one question. When x=4, Hash function's output is 5 and there are 5 zeros in tail. Therefor our max R is 5 and distinct elements will be 32. But in input stream we have 4 distinct elements. I think, we should not count all-zero element. May you explain more, please?