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 9190573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:29:36+00:00 2026-06-17T20:29:36+00:00

I promise this is the last Big O question Big O Notation for following

  • 0

I promise this is the last Big O question

Big O Notation for following loops…

     for (int i = n; i > 0; i = i / 2){
        for (int j = 0; j < n; j++){
           count++;
        }
     }
     for (int k = 0; k < n; k++){
        for (int m = 0; m < n; m++){
           count++;
        }
     }

here is what i think im sure of.

the first set of nested loops has O(n*log2(n)) and the second set of nested loops is O(n^2). When adding these is it correct to drop the first term? and say that the overall Big O is O(n^2)?

Second question, when adding Big O notation for loops in series is always correct to drop the less significant terms?

  • 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-17T20:29:38+00:00Added an answer on June 17, 2026 at 8:29 pm

    The answer to both your questions is yes. You always drop smaller terms, as they are dominated by the larger terms for sufficiently large n, and you only care about large n when doing Big O analysis.

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

Sidebar

Related Questions

Ok, last question for today I promise! I have the following line of code
Last question for tonight, I promise. These pointers are giving me a serious headache.
I'm usually a lot better than this, I promise. Back story here: At my
Since this is answered I put the simplest answer here. (Thanks to Bergi) first
Ok, last edit, promise: With the following class: public partial class MembershipModule : BaseConnection<MembershipModule>
This question is regarding the mad functions available in OpenCL which promise significant improvements
I promise you I am not lying. There is one strange line in this
You have to promise not to giggle, but my situation is following: Instead of
I'm returning a promise from a function like this: resultPromise = dgps.utils.save(opportunity, '/api/Opportunity/Save', opportunity.dirtyFlag).then(function
Like the author of this question I'm trying to understand the reasoning for user-visible

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.