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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:08:07+00:00 2026-06-12T13:08:07+00:00

I am looking for an algorithm which stores a long list (possibly thousands) of

  • 0

I am looking for an algorithm which stores a long list (possibly thousands) of random numbers and retrieves them efficiently. Typically the solution should not require any sorting of data i.e the numbers are stored as they are generated, And the storage space required should be less than that required for an array/hash of such numbers. New numbers can be added to the list.

  • 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-12T13:08:08+00:00Added an answer on June 12, 2026 at 1:08 pm

    @Stemm has a very good idea of just storing the seed to the pseudo-random number generator (prng). The count of the numbers would also be required so that you would know how many times to call prng to retrieve them.

    If you don’t have access to the seed or the numbers are otherwise random, then you might have another option. If your numbers are integers, not very big, and you know there are no duplicates, then consider storing them as bits. So, for example, if your longest value fits in a 2 byte int, then that value could be stored by using 1 bit. Some examples:

    0 = 1.

    4 = 10000 binary or 10 hex.

    10 = 10000000000 binary.

    If the largest value is 65535, which is the largest value that can fit inside of a 16 bit unsigned integer, then the amount of memory to hold all the values can be calculated as 65536 / 8 = 8192 bytes. If you are using Java, take a look at the java.util.BitSet or java.math.BigInteger classes to help do this.

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

Sidebar

Related Questions

I was looking for this algorithm (algorithm which will randomly select from a list
I am looking for a simple but efficient Objective-C algorithm which, starting from a
I am looking for a command line either for an algorithm (script) which allows
I'm looking for a javascript diff algorithm implementation or library, which has been tested
I'm looking for an algorithm which can generate a short (fx 16 chars (not
I am looking for an algorithm to encrypt secret numbers on a mobile device
I am looking for an algorithm which takes as input a set of two
I'm looking for an algorithm which can take two sets of integers (both positive
I'm looking for an algorithm for which I do not have the VBA knowledge
I'm looking for a generic algorithm which, given the range values start and end

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.