Start New Discussion within our Software Development Community

I have so much trouble with this questions not only questions I want to study big o and time complexity but until now I didn’t found any good sit that explained it so could anyone help me by proved some sits about big o and time complexity and I really need help to solve thes questions cuz I don’t know how to calculate time complexity and big O could anyone help me with the answer and the Explanation please


These are the questions

algorithm to print the m smallest elements in an array of size n. Find its time complexity in terms of m and n.

algorithm that prints all possible subsets of three elements among a set of n elements. Find the time complexity of your program.

Show that n2 + 3 n 3  O(n3).
5n5+4n4+6n3+2n2+n+7  O(n5).

Sort functions in decreasing complexity order:
nLn n ; (lg n)2; 5n2 + 7 n ; n 5/2 ; n! ; 2n! ; 4n; nn; nn + Ln n;
5 log n; sqrt(n); en; 8n+12; 10n+n20.

Find the time complexity of the following programs :

(a) for (i=7;i<=(7+n) ; i++)
x=x+p;


(b) for (i=1;i<=66;i++)
for (j=1;j<=n; j++)
A[j]=1;

(c) for (i=1;i<=n;i++)
for (j=1;j<=i;j++)
y=y+n;

(d) for (i=1;i<=n;i++)
for (j=1;i<=n; j++)
for (k=1, k<=n; k++)
C[j] = C[j]+A[k]*B[k][j];

(e) Assume that n is a power of 2, find the time complexity of the following program:
i=1;
while (i<=n)
{ for (j=1;j<=n;j++) cout<<”1”;
i=i*2;
};


I really need the answer and the Explanation as soon as possible

This article has been dead for over six months. Start a new discussion instead.