Any algorithm that does not have a loop will have time complexity as ____.
Any algorithm that does not have a loop will have time complexity as ____.
Solution
✅ Correct Option: 2
Without a loop, every statement runs a fixed number of times, whatever the input size . The running time is therefore constant, written .
Option 3: time complexity is never , because even a single statement takes some constant time to execute.
Options 1 and 4: comes from a loop running times, and from a loop that halves or doubles its counter each step. Both need a loop.
A loop-free algorithm can still be slower than if it uses recursion, but the question assumes simple straight-line code.
Related questions:
2026: 11 May Shift 2
2026: 23 May Shift 1
2025: 13 May Shift 2