An algorithm with a single loop running from 1 to n has a time complexity of:
An halved
Bn doubled
Cn alone
Dn cubed
Answer & Solution
Correct answer: C. n alone
1. The body executes once for each element.
2. That gives n executions in total.
3. So the complexity is n alone.
_Source: syllabus Computer Science Class XII, Chapter 5, Sorting._
Keep practising Sorting Algorithms
Browse all Sorting Algorithms questions for Engineering — Tanzania, or explore more Computer Science topics.