October 3rd, 2012 05:20 AM
#1
Big O Notion Help for project
hello guys i am in 3th years of studying in uni,i am toke this example as a heading of my project and need answers for it with all thanks, i am software eng
first part: O(g(n)) for this:
(n + 3 )(n + n2+ 4)
5logn+3n+1000
Logn+ 100 +1/ n2
100n2+ ½ n3 +5
(3n2 + 4)3
second part : number of operation of this
1)
if (condition)
{ cout<<”Hello”<<endl; }
else
{
for (i = 0; i < N; i++) {
cout<<”Hi”<<endl;
}
}
2)for (i = 0; i < N; i++) {
for (j = i+1; j < N; j++) {
sequence of statements
}
}
3)for (i = 0; i < 2*N; i++) {
sequence of statements
}
for (j = 0; j < M-1; j++) {
sequence of statements
}
4)
void fun(int k)
{
for (i = 0; i < N; i++) {
sequence of statements
}
}
void main(){
//declaration statements
for (i = 0; i < N; i++) {
fun(i);
}
}
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width
Bookmarks