MCQs Asymptotic Notations Worst, Average and Best Case Time Complexities Analysis of Loops

1. What is the time complexity of fun()? int fun(int n) { int count = 0; for (int i = 0; i < n; i++) for (int j = i; j > 0; j–) count = count + 1; return…
Empowering coders, one solution at a time
Empowering coders, one solution at a time
1. What is the time complexity of fun()? int fun(int n) { int count = 0; for (int i = 0; i < n; i++) for (int j = i; j > 0; j–) count = count + 1; return…