I'm programming a learning software It works with question / answercard Now I need an algorithm that 0 - 100 to take the integer-value additive card randomly indicates how many times the user has answered the correct answer.
My real idea is to count all integer values, make a random integer between 0 and math integers, and use my integer to use my integer and till i Count until you reach, count your integer. Then I reach the integer to choose this card: -)
But there should be a better solution; -)
I think the simplest plan you describe is not inappropriate for the problem .
If at some point in the future you find that it is insufficient (like it is very slow), then you can think of optimizing it.
Binary tree with card on the node of a possible adaptation Avenue and every intermediate node in which the "digit" of the card is below. In this structure the card is going through a random integer, and updating the score of the card can be done both logarithmic times.
Comments
Post a Comment