Q1: Analyze the following Algorithms. Find their running time and asymptotic notations. Algorithm 1 int fun(int n) { int count = 0; for (int i = 0; i 0; j-) { count = count + 1; } } return count;


Q1: Analyze the following Algorithms. Find their running time and asymptotic notations.<br>Algorithm 1<br>int fun(int n)<br>{<br>int count = 0;<br>for (int i = 0; i < n; i++)<br>{<br>for (int j = i; j > 0; j-)<br>{<br>count = count + 1;<br>}<br>}<br>return count;<br>

Extracted text: Q1: Analyze the following Algorithms. Find their running time and asymptotic notations. Algorithm 1 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 count;

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here