I want to generate 1billion random integer with no duplication, I dont know how do I allocate memory for such a huge amount of data.
jgehlot09
0
Newbie Poster
Recommended Answers
Jump to PostWell, there is an easier and more efficient way to generate non-repeating random numbers. The algorithm is:
generate all the (non random) sequential numbers you need, and put them into an array (any data structure would perhaps do, but an array is easy).
Then shuffle the numbers in …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.