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

  • Home
  • SEARCH
  • 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 9000669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:20:22+00:00 2026-06-16T00:20:22+00:00

Suppose I have an algorithm with memory requirement of logN+1 where N is the

  • 0

Suppose I have an algorithm with memory requirement of logN+1 where N is the size of the problem (number of bits to process). I propose a 2nd version that reduces this memory requirement to (logN)/2+1. I have learnt that constants are ignored in Big-O analysis, so both the algorithm versions have complexity of O(logN).

Now, if I calculate the memory that I saved using the 2nd version of the algorithm, I get

Memory saved at N = M(N) = 1 – [(logN)/2+1]/[logN+1]
lim N→∞ M(N) = 1/2

which shows that asymptotically I will always save 50% of the memory. I am confused why I am unable to see this gain in Big-O analysis?

My second question is: If my understanding about Big-O notation is wrong, what is a proper way of highlighting the memory saved in 2nd version of the algorithm?

  • 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-16T00:20:23+00:00Added an answer on June 16, 2026 at 12:20 am

    Remember that big-O notation does not include constant factors. The functions f(n) = n and g(n) = 10100n are both O(n), though f(n) is a much, much smaller function than g(n).

    Your analysis is correct – if you can make the space usage (log n) / 2 – 1, then you will (in the limit) be halving the amount of memory required. However, this will not show up in a big-O analysis, since big-O ignores the constant factors. As mentioned in some of the other answers, big-O notation captures long-term growth rates, and although constants might tell you more about the absolute amount of space used, constants don’t control the long-term growth rate of the space usage.

    If you want to do a more precise analysis, you could give the exact memory usages before and after and then say that you have reduced the memory usage by 50%. Many papers on algorithms and data structures do actually include the constant factors and mention that they’re getting a constant speedup. For example, the Cholesky factorization algorithm and Gaussian elimination both give O(n3) algorithms for solving linear systems, but when the Cholesky factorization can be used it does so with about 50% fewer operations. Most textbooks covering these topics will mention that although both algorithms are O(n3), the former is preferable to the latter when it’s possible to use it.

    Hope this helps!

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

Sidebar

Related Questions

Suppose I have a recursive algorithm that splits input into 2 inputs of size
Suppose I have a process that is updating a record and encounters a record
Suppose I have: Toby Tiny Tory Tily Is there an algorithm that can easily
For instance, suppose I have an algorithm that's O(n) and an algorithm that's an
Given an arbitrary floating point number, say -0.13 , suppose we have an algorithm
I'm trying to solve an algorithm problem involving chess. Suppose I have a king
suppose you are given the following problem. You have two index sets that have
This is regarding AES algorithm. Suppose i have implemented a AES algorithm and encrypt
Suppose I have a pure virtual method in the base interface that returns to
Suppose I have a static method of my class that returns an object of

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.