A loop within a loop will have the time complexity as __________.
A loop within a loop will have the time complexity as __________.
Solution
✅ Correct Option: 1
If the outer loop runs times and, for every pass, the inner loop also runs times, the inner statement executes times.
Option 2: comes from a single loop where the counter is doubled or halved each time, not from nesting.
Option 3: is the time for a single loop.
Option 4: needs three nested loops, each running times.
Related questions:
2026: 11 May Shift 2
2026: 26 May Shift 1
2025: 13 May Shift 2
2025: 30 May Shift 2