This is the implementation of a Count Distinct Problem in particular the CVM algorithm
scala Test <m> <n> <window size>
where:
- m -> is the length of the random sequence
- n -> is the max number of symbols
- window size -> the window size
sh %> scala Test.scala 30000 4000 100
Result: exact(3996), estimation(3968.0)
To compile the program:
scalac *.scala
Run the bytecode:
sh %> scala Test 30000 4000 100
Result: exact(4000), estimation(3776.0)