4 ms·
"You could also use ranges, picking a random number between 0.0 and 1.0 and returning :win when the number is below 0.8, :lose otherwise. But, these algorithms
by pgsandstrom 14y ago
"You could also use ranges, picking a random number between 0.0 and 1.0 and returning :win when the number is below 0.8, :lose otherwise. But, these algorithms are still O(n)"
Maybe my math is a bit rusty, but is this really O(n)? Why is that?
- andreer 14y agon here is the number of different elements you can choose from. If there was a third alternative, you'd have to add another if statement.