How will one go about extracting a random number from a bitset ? let's say i have a bitset 100000010000101000100010001 where 1 denote what numbers are currently present in the set How can one extract these ones in a random manner .Generating a random number modulo size of the bitset won't work as it can land upon a zero value as well and this , in worst case can take O(size of bitset * genarating pseudo random number ) time which is very costly . Anybody knows how to do this ?
-- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.