Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Time complexity(theta) for loops with special case?

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Time complexity(theta) for loops with special case?

    I can't able to find the theta for some type of code like.

    for(i=1;i<=n;i++){ 
    for(j=i;j>=1;j=j/3){ 
    .... 
    } 
    }

    How to find the theta for the above code.

    It will be really helpful if some one help me how to find it in general case like.

    for(i=1;i<=n;i++){ 
    for(j=i;j>=1;j=j/K){ 
    .... 
    } 
    }

    and How to find number of steps or time complexity for inner loop if k=3 (odd)


    Thanks in Advance


  2. #2
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: Time complexity(theta) for loops with special case?

    This thread has been cross posted here:

    http://www.coderanch.com/t/639308/java/java/Time-complexity-theta-loops-special
    http://stackoverflow.com/questions/25738561/time-complexitytheta-for-loops-with-special-case
    https://answers.yahoo.com/question/index?qid=20140909143859AAP9XeG

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting


  3. The Following User Says Thank You to Darryl.Burke For This Useful Post:

    copeg (September 10th, 2014)

Similar Threads

  1. Time complexity problem?
    By Scorks in forum Java Theory & Questions
    Replies: 0
    Last Post: February 2nd, 2014, 06:39 PM
  2. Time complexity and algorithms
    By keepStriving in forum Algorithms & Recursion
    Replies: 3
    Last Post: October 21st, 2013, 03:41 PM
  3. Special Functions and Computational Complexity
    By rhym1n in forum Algorithms & Recursion
    Replies: 0
    Last Post: April 1st, 2013, 06:23 PM
  4. time complexity qustion
    By romavolman in forum Java Theory & Questions
    Replies: 1
    Last Post: September 18th, 2012, 07:45 PM
  5. time complexity qustion
    By romavolman in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 18th, 2012, 06:24 PM

Tags for this Thread