Q-2 Find the Complexity of the following Algorithm. 1. Initialize sum to 0. 2. Initialize index variable i to 0. 3. While i


Q-2 Find the Complexity of the following Algorithm.<br>1. Initialize sum to 0.<br>2. Initialize index variable i to 0.<br>3. While i< n do the following:<br>4.<br>a. Add xl] to sum.<br>5.<br>b. Increment i by 1.<br>6.<br>c. if(sum%2)<br>7.<br>else continue;<br>8. Calculate and return mean = sum/ n.<br>Answer - T(n) =<br>

Extracted text: Q-2 Find the Complexity of the following Algorithm. 1. Initialize sum to 0. 2. Initialize index variable i to 0. 3. While i< n="" do="" the="" following:="" 4.="" a.="" add="" xl]="" to="" sum.="" 5.="" b.="" increment="" i="" by="" 1.="" 6.="" c.="" if(sum%2)="" 7.="" else="" continue;="" 8.="" calculate="" and="" return="" mean="sum/" n.="" answer="" -="" t(n)="">

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here