Algorithm to test minimum hamming distance against a set?
问题 I have a relative straightforward thing I want to do: Given a query number Q, a query distance d, and a set of numbers S, determine whether or not S contains any numbers with Hamming distance less than or equal to d. The simplest solution is to just make S a list and iterate over it, computing distances. If a distance less than or equal d is computed, bail out an return TRUE. But considering that all I want to do is check for an existence, something faster than a linear time solution should