PA of Algorithms Q48

  • Option : C
  • Explanation :
    If n is a power of 2, then
    term
    If n is not a power of 2, then there will be minor differences of 1 at wherever is odd.
    Hence val(j) computed on the basis of n = 2n will give a fair answer

    = 2(n – 1) = θ(n)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *