如何从http://docs.oracle.com/javase/1.4.2/docs/api/java/util/BitSet.html> rel=“nofollow noreferer”>Java BirSet of lengthm
with
Example input: m=20, n=11
Example output: k=3
The naive approach
选择随机编号0≤ i ≤ m-1
. 如果该编号在投入上转而没有在产出上转,则该编号在产出中转至k
bits在产出中转手。
This approach fails when n
is much smaller than m
. Any other ideas?