The Hamming distance between two bit strings of length (n) is equal to the number of bits
Question:
The Hamming distance between two bit strings of length \(n\) is equal to the number of bits in which the two strings differ. Write a program that reads in an integer \(k\) and a bit string \(s\) from the command line, and prints all bit strings that have Hamming distance at most \(\mathrm{k}\) from \(\mathrm{s}\). For example, if \(\mathrm{k}\) is 2 and \(\mathrm{s}\) is 0000 , then your program should print 0011 0101 0110 1001 1010 1100
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Introduction To Programming In Java An Interdisciplinary Approach
ISBN: 9780672337840
2nd Edition
Authors: Robert Sedgewick, Kevin Wayne
Question Posted: