algorithm analysis help

This is a discussion on algorithm analysis help within the C++ Programming forums, part of the General Programming Boards category; the site doesnt let me post my question although I use code tags please read here hi guys i have ...

  1. #1
    nik
    nik is offline
    Registered User
    Join Date
    Nov 2010
    Posts
    44

    algorithm analysis help

    the site doesnt let me post my question although I use code tags

    please read here

    hi guys i have this exercise and I m not sure if I'm correct [CODE]for (i=0 - Pastebin.com

    thanks

    hi guys

    <<< Copy/Pasted by mod >>>
    i have this exercise and I m not sure if I'm correct
    Code:
    for (i=0;i<=n-2;i++){
         for(j = i+1; j<= n-1; j++){
               if (A[i,j] != A[j,i])
                     return false;
               }
       }
    a. What does this algorithm compute?
    b. What is its basic operation?
    c. How many times is the basic operation executed?
    d. What is the efficiency class of this algorithm?
    e. Suggest an improvement or a better algorithm altogether and indicate its efficiency class. If you cannot do it, try to prove that in fact it cannot be done.


    a. it checks to see if the array is symmetrical
    b. the if operation
    c. http://latex.codecogs.com/gif.latex?...{j=i+1}^{n-1}1
    d. O(n^2), can this be Θ(n^2)?
    e. i dont think we can, since we have to check all the arrays elements to see if they match
    Last edited by Salem; 06-01-2011 at 11:07 AM. Reason: Seems easy enough to paste..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beam or Frame Analysis for Structural Analysis
    By greenmania in forum C Programming
    Replies: 3
    Last Post: 05-05-2010, 06:40 PM
  2. Code Analysis
    By guesst in forum C++ Programming
    Replies: 8
    Last Post: 09-09-2008, 05:17 PM
  3. Audio Analysis
    By d_henson in forum Tech Board
    Replies: 5
    Last Post: 03-13-2004, 03:59 PM
  4. Big-O analysis
    By Unregistered in forum C++ Programming
    Replies: 6
    Last Post: 06-26-2002, 02:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21