Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9271631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:40:08+00:00 2026-06-18T15:40:08+00:00

Is O(n^2) is greater than O(n^2 log n) ? If yes ? how ?

  • 0

Is O(n^2) is greater than O(n^2 log n) ?
If yes ? how ?
Can we have a simple example for this.
Also ,
What is complexity of the code below.

int unknown(int n){
   int i,j,k=0;
   for(i=n/2;i<=n;i++){
     for(j=2;j<=n;j=j * 2){
         k =k + n/2;
     }
  }
return k;
}

and What is complexity of return value k ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:40:09+00:00Added an answer on June 18, 2026 at 3:40 pm

    O(n^2) is a subset of O((n^2) * log(n)), and thus the first is “better”, it is easy to see that since log(n) is an increasing function, by multiplying something with it, you get a “higher” function then the original (f(n) <= f(n) * log(n) for each increasing non negative f and n>2)

    The code snap you gave is O(nlog(n)), since the inner loop repeats log(n) times per outer loop iteration, and the outer loop repeats n/2 times – which gives you n/2 * log(n) which is in O(nlog(n))

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can limit an array to values less than or greater than using individual
How can I get all td elements with 'colspan' greater than 1 in jQuery?
I sent a multi-line data with length greater than 20. I'm sure of this
How can I find the least prime number greater than a given number? For
I have an Oracle 10g table that contains a # of log records. This
MySQL (5.1.41-3ubuntu12.10-log) seems to give predictable results on string comparison using > (greater than)
I see a lesser than and greater than side by side in Brightscript. What
If I pass a value greater than 100 as the second argument to BinaryInsertionSort,
I'm trying to find all Users with an id greater than 200, but I'm
I need to find out how many times the number greater than or less

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.