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.


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

Results 1 to 2 of 2

Thread: Order of growth

  1. #1
    Member Scorks's Avatar
    Join Date
    Jan 2013
    Thanked 0 Times in 0 Posts

    Default Order of growth


    We recently started Time complexity/order of growth in my computer science class, and we were given a table with a number of different order of growth definitions ((O)N^2, O(N^3), O(N!), etc...) So, I haven't seen a definition describing anything like N^9 or N^8. What kind of order of growth would we classify something like n^10 + 9n^9 + 20n^8 + 145n^7?

    2. In the case of something like n + 0.001n^3, where the higher n power is multiplied by a small number, would that still be O(N^3), or not?

    Thanks a lot!

  2. #2
    Senior Member
    Join Date
    Jul 2013
    Thanked 121 Times in 105 Posts

    Default Re: Order of growth

    O(n^10 + 9n^9 + 20n^8 + 145n^7) == O(n^10)
    O(n + 0.001n^3) == O(n^3)

    The run time analysis only cares about the largest exponent. If n is going towards infinity the importance of smaller exponents becomes insignificant.
    Or to phrase it differently, if we assume the following function:
    n + C * n^2
    Then for every constant C > 0 that you can imagine I can find an n, so that C * n^2 > n.
    No matter how close your C is to 0, the quadratic growth is still superior to the linear growth when looking at large enough n.

Similar Threads

  1. Order of printing
    By DerrickMartin in forum Java Theory & Questions
    Replies: 2
    Last Post: February 20th, 2013, 05:54 AM
  2. [SOLVED] Alphabetical order
    By sbjibo in forum What's Wrong With My Code?
    Replies: 12
    Last Post: May 16th, 2012, 03:20 PM
  3. Stack Order?
    By TimW in forum AWT / Java Swing
    Replies: 2
    Last Post: September 19th, 2009, 07:33 AM

Tags for this Thread