Consider a binary search implementation where each step performs exactly one comparison to check equality, and if false, a second comparison to check less-than. Let be the maximum number of comparisons for an array of size . Which of the following statements is/are TRUE?
I. is a non-decreasing function of .
II. for all .
III. If , then must be exactly 64.
IV. for all .
["A"]
Step-by-Step Solution
Key idea: . Analyze each statement using the properties of the floor function and logarithms.
Step 1: Statement I: As increases, is non-decreasing, so is non-decreasing. True.
Step 2: Statement II: . . They are not equal. False.
Step 3: Statement III: . is not necessarily exactly 64. False.
Step 4: Statement IV: We know for all integers . Thus , which means is true (it is actually an equality).
Answer: I and IV only (Option A).