Given a binary string S 01...010 with N bits, and a string comparison operator Op(s1, s2) with outputing only 1 bit value. Suppose the binary string S have K "1".
Please give an algorithm to decide the positions of all the bits valued 1 and analyze its time compleixty in terms of operation. Can we even analyze the overall time complexity with the time complexity of operation.
Wednesday, April 9, 2008
Subscribe to:
Post Comments (Atom)
1 comment:
Considering an extreme case with K = 1, binary-search may find the position with time complexity O(logN)operations.
Post a Comment