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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:38:46+00:00 2026-06-14T02:38:46+00:00

If I have an algorithm,where the input is just a number and the output

  • 0

If I have an algorithm,where the input is just a number and the output is its set of divisors.So my input will always be one number and the number of iterations in the algorithm will depend on how big the number is.What will be the big-oh notation of such an algorithm?
Algorithm:

1: Set m := 2.
2: Set S := {} for S a multi-set.
3: while m  <= n^0.5
do
4: if m divides N then
5: Set S U m
6: else
7: Set m = m + 1.
 8: end if
 9: end while
 10: Return the set S of divisors found.
  • 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-14T02:38:47+00:00Added an answer on June 14, 2026 at 2:38 am

    You can either let the variable in big-O notation for the asymptotic complexity be the input number itself, or it can be the number of bits needed to express that number. These two conventions give rise to dramatically different asymptotic classifications, so it is important to be clear about which one you use when you report the result.

    In general people tend to use the number-of-bits convention when they are speaking about cases where the number is so large that you need bignums, and the meaning-of-the-number convention when the inputs are bounded by the size of a machine word. But that’s not something you can rely on other than to get a first guess which you’ll need to verify for yourself makes sense in your particular situation.

    The choice tends to go hand-in-hand with the cost model you’re using for arithmetic operations. When you’re counting bits it’s typical to assume that arithmetic on n-bit values take O(n) time, whereas when you’re working with the meaning of the input number, you typically assume that arithmetic on numbers work in constant time.

    In your case you would get something like O(2^n) or O(sqrt(m)) where n is the number of bits in the input and m is the input itself. (Details depend on how your multiset primitives perform).

    See also pseudo-polynomial time.

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

Sidebar

Related Questions

I have a form with input field which can be accessed like var algorithm
If I have a number like 12345, and I want an output of 2345,
I have algorithm of calculating average speed in pure python: speed = [...] avg_speed
I have algorithm of calculation of the difference between neighboring elements in pure python:
I have algorithm/computation in Java and unit test for it. The unit test expects
I have an algorithm that finds the minimum of function/n on Rn. And I
I have an algorithm that finds a value in a cell, for this case
I have an algorithm in C++ that uses Kalman Filter. Somewhere in the code
I have this algorithm in Java to store passwords in database. I'd like to
I have an algorithm that recursively makes change in the following manner: public static

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.