Posted by hussein on July 31, 1999 at 17:23:04:
In Reply to: proj 4 random number generation posted by B on July 31, 1999 at 16:36:54:
: I'm using the random number generator in C++ to insert random numbers into my unsorted array. Using this function, I have to use the modulus operator so that the function can pick from any range of numbers (i.e., to pick a number between 0 and 99, I say array[i] = rand() % 100). Is there any particular range of numbers that I should use? Obviously for an array of 100 items, I should not pick numbers between 0 and 10 because this will result in too many duplicates. However, would a random generation of numbers between 0 and 300 be sufficient for an array of 100 items? Thanks.
sure - 0-300 sounds ok ...
---
hussein