For a list of length , the single-index scan uses the base condition i >= len(L) - 1. What is the minimum value of for which the function will execute at least one comparison (i.e., not immediately hit the base case at )?
C
Step-by-Step Solution
Key idea: The base condition prevents accessing out-of-bounds indices.
Step 1: The condition is i >= len(L) - 1. For , len(L) - 1 = 0. At , 0 >= 0 is true, so it hits the base case immediately without comparing.
Step 2: For , len(L) - 1 = 1. At , 0 >= 1 is false, so it proceeds to compare and .
Answer: C