mercredi 2 août 2017

Random number generators for a skiplist implementation

Most skiplists guides I see use an LCG random number generator and the following formula to generate the node heights.

random.generate().trailingZeroBitCount + 1

But LCGs have bad randomness in the lower order bits. Is this a problem, and if so what’s a good random number generator for skiplists?




Aucun commentaire:

Enregistrer un commentaire