Course Solutions Uncategorized (Solved) : Determine Running Time Form O N Briefly Explain Q28893722 . . . .

(Solved) : Determine Running Time Form O N Briefly Explain Q28893722 . . . .

 

Determine running time in the form of O(n) and briefly explainwhy.

1. for ( int i 0; i < n; i+-2 ) sumtti 2.for int -1 n2 i<n sum++

1. for ( int i 0; i < n; i+-2 ) sumtti 2.for int -1 n2 i<n sum++ Show transcribed image text

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Clc Input Enter First Number Take First Number B Input Enter Second Number Take Second Num Q33390606 . . . .(Solved) : Clc Input Enter First Number Take First Number B Input Enter Second Number Take Second Num Q33390606 . . . .

<p>clc</p><p>a=input('Enter the first number:'); % take first number</p><p>b=input('Enter the second number:'); % take second number</p><p>llim=min(a,b); ulim=max(a,b);</p><p>count=0;</p><p>for k=llim:1:ulim num=k;</p><p>sum=0;</p><p>flag = num;</p><p>while(num>0)</p><p>remain = rem(num,10);</p><p>sum = sum + remain*remain*remain;</p><p>num = fix(num/10);</p><p>end</p><p>if(sum==flag)</p><p>count=count+1;</p><p>armstrong(count,:)=flag;</p><p>end</p><p>end</p><p>fprintf('Armstrong number(s) between