7 ms·
hmm you can randomise the time at which you next put something into the stream right? I am thinking you can sleep() until the next time, just by doing rand() *
by willbw 7y ago
hmm you can randomise the time at which you next put something into the stream right? I am thinking you can sleep() until the next time, just by doing rand() * someMultiplier * aSecond
- stcredzero 7y agoHow do you do that and wind up with a stochastic O(1) space as opposed to O(n) space? (Remember, O(n/K) is O(n))