Any algorithm that has a loop (usually 1 to n) will have the time complexity as ________.
Any algorithm that has a loop (usually 1 to n) will have the time complexity as ________.
Solution
✅ Correct Option: 1
A simple loop that runs from 1 to executes its body once for each value, so the work grows in direct proportion to . Its time complexity is , called linear time.
Option 2: comes from a loop nested inside another loop, each running up to .
Option 3: comes from a loop whose counter is multiplied or divided by a constant each time (for example ), not one that increases by 1.
Option 4: comes from a loop of steps that does work in each step, as in merge sort.
Related questions:
2026: 13 May Shift 2
2025: 13 May Shift 2
2025: 3 June Shift 2