PA of Algorithms Q50

  • Option : D
  • Explanation :
    Since, j increases in power of 2's.
    if statement j = j * 2 executes k times, then
    2k < n
    ⇒ k < log2 n
    Since k will be integer,
    total number of comparison
    (when loop exits)
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 *