Results 1 to 2 of 2

Math Help - Totally confused on time complexities.

  1. #1
    ob1
    ob1 is offline
    Newbie
    Joined
    Mar 2013
    From
    America
    Posts
    2

    Totally confused on time complexities.

    I am studying Computer Science.

    Currently we are doing time complexities of loops..

    I am confused on how to count the repetitions of the loop..

    For example

    For ( i=1; i<=n; i++)
    For (int j=1; j<=2; j x= 2)

    i j reps
    1 1-2 2
    2 1-2^2 3
    3 1-2^2 3
    . .
    . .
    . .
    n 1-2^n ?


    Do you count the inner loop? Do you add up the previous repetitions?

    Im just totally confused.

    Any break down would be appreciated. Thanks guys
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,527
    Thanks
    773

    Re: Totally confused on time complexities.

    My browser shows the third part of the inner "for" as "j x= 2". If this is so, then it is an error because x is not declared and because j cannot be applied to x since j is not a function.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Adding and Subtracting Time ? Confused?
    Posted in the Business Math Forum
    Replies: 5
    Last Post: July 1st 2012, 05:05 AM
  2. Totally confused! Where is the missing number?!
    Posted in the Math Topics Forum
    Replies: 1
    Last Post: April 13th 2012, 02:14 PM
  3. Replies: 2
    Last Post: January 10th 2010, 08:45 AM
  4. Replies: 5
    Last Post: November 21st 2009, 07:28 PM
  5. I'm totally confused!
    Posted in the Algebra Forum
    Replies: 7
    Last Post: December 15th 2008, 01:58 PM

Search Tags


/mathhelpforum @mathhelpforum