Anúncio
(i)Find T(n)- the time complexity (as operations count) in the worst c.docx
(i)Find T(n)- the time complexity (as operations count) in the worst c.docx
(i)Find T(n)- the time complexity (as operations count) in the worst c.docx
Próximos SlideShares
) The positively polarized carbon atom of a carbonyl group acts as A).docx) The positively polarized carbon atom of a carbonyl group acts as A).docx
Carregando em ... 3
1 de 3
Anúncio

Mais conteúdo relacionado

Mais de dorisc7(20)

Anúncio

(i)Find T(n)- the time complexity (as operations count) in the worst c.docx

  1. (i)Find T(n), the time complexity (as operations count) in the worst case? (ii)Express the growth rate of the function in asymptotic notation in the closest bound possible. (iii)Prove that T(n) is Big O (g(n)) by the definition of Big O (iv)Prove that T(n) is (g(n)) by using limits Solution Operations Times Sum=0 C1 1 for(int i=0;i<n;i++) C2 n for(int j=0;j<n;j++) C3 n for(int k=0;k<n;k*2){ C4
  2. Log n sum=i+j+k; C5 Log n } i) fT(n) =n 2 log n 2) The growth rate is O(n 2 log n) 3)T(n) is Big O(n 2 log n) Operations Times i=1; C1 1 While(i<=n){ C2 n J=I; C3 n While(j<=n){ C4 n^2 System.out.print(j);
  3. C5 n^2 J++; C6 n^2 } I++; C7 n } 1. T(n) is n^2 2.O(n^2) Operations Times Sum=0 C1 1 for(int i=0;i<n;i++) C2 n for(int j=0;j<n;j++) C3 n for(int k=0;k<n;k*2){ C4 Log n sum=i+j+k; C5 Log n }
Anúncio