Sponsored Links


Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: CS502 assignment no 2 spring 2011

  1. #1

  2. #2
    Senior Member
    Join Date
    Jan 2011
    Posts
    200
    please start working on this assignment

  3. #3

  4. #4
    Senior Member
    Join Date
    Jan 2011
    Posts
    200
    please please please

  5. #5

  6. #6
    Junior Member
    Join Date
    Apr 2011
    Posts
    12
    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)

  7. #7
    Senior Member
    Join Date
    Jan 2011
    Posts
    200
    sorry but it is not related with current assignment

  8. #8
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,239
    moon shaib kabhi thanks nahi kaha app nay solution lay akr.

  9. #9
    Junior Member shafiq856's Avatar
    Join Date
    Jul 2010
    Location
    Muzaffargarh
    Posts
    14

    CS502 Assignment No.2 Question No.2

    CS502 Question No. 2 Hazir Hai.
    See the attachment.
    Attached Files Attached Files

  10. #10
    Junior Member
    Join Date
    Jul 2010
    Posts
    1

    Icon16 CS502 solution thanx

    Quote Originally Posted by shafiq856 View Post
    CS502 Question No. 2 Hazir Hai.
    See the attachment.
    Thank you very much

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 8
    Last Post: 11-10-2011, 09:35 PM
  2. Replies: 11
    Last Post: 10-29-2011, 09:36 PM
  3. Replies: 4
    Last Post: 07-10-2011, 04:16 AM
  4. Replies: 0
    Last Post: 06-12-2011, 02:59 AM
  5. CS502 assignment no 2 spring 2011
    By moon13 in forum Get Solution In 24 Hour
    Replies: 16
    Last Post: 05-08-2011, 04:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft