Random Number
Start Timer
0:00:00
Given a stream of numbers, select a random number from the stream with equal probability and space in selection.
Input:
def random_number(x, y=0, count=1):
pass
xis the new value from the stream.yis the previously selected value.countis the size of the stream.
.
.
.
.
.
.
.
.
.
Comments