04-30-2011, 08:31 AM
please help me about this assignment
|
CS502 assignment no 2 spring 2011
|
|
04-30-2011, 08:31 AM
please start working on this assignment
05-01-2011, 12:29 AM
working working and working
05-02-2011, 08:51 PM
please please please
05-02-2011, 10:10 PM
GGGG moon what do u do?
05-07-2011, 02:53 AM
Question 1
Rule 0 The condition that stops a loop executes ONE MORE time than the loop itself (the last time is when it is evaluated false) Rule 1 for (i=0;i<n;i=i+k) Anything inside the loop will run approximately n/k times Rule 2 for (i=n;i>0;i=i-k) Anything inside the loop will run approximately n/k times Rule 3 for (i=1;i<n;i=i*k) Anything inside the loop will run approximately logkn times Rule 4 for(i=1;i<=n;++i) for (j=1;j<=i;++j) The above nested loop approximately runs ½ n(n+1) times. The variable j depends upon the value of i Rule 5 for(i=1;i<=n;i=i*2) for (j=1;j<=i;++j) The statements in the above nested loop approximately run 2n-1 times. The variable j depends upon the value of i Rule 6 If the loop variables are independent then the total times a statement inside a nested loop is executed is equal to the product of the times the individual loops run e.g. for (i=0;i<n;++i) for (j=0;j<m;++j) A statement inside the above nested loop will run n*m times Question 2 (10) Arrange the following in the Most to Least complexity order. Here “n “is the input size for the some complexity function and k< j and j & k are numbers greater than 2.Every function is separated by “comma” and note these are 20 functions to arrange. 2 2 4 8 5 6 n, n / 2, n j/2, nlgn, nn, 1,100, 2n, lgn, n!,(n! ) / , / ,n! log / , / log ,10000,n / , (log ) , n / , (log ) ,1000 k n n n n n n n n n n nn n n n n n n plz check and if corection is required then tell me. thanks (Remember in prayers)
05-07-2011, 03:40 AM
sorry but it is not related with current assignment
05-07-2011, 03:44 AM
moon shaib kabhi thanks nahi kaha app nay solution lay akr.
05-08-2011, 03:38 AM
shafiq856 Wrote:CS502 Question No. 2 Hazir Hai. Thank you very much |
|
« Next Oldest | Next Newest »
|