3 ms·
A priority queue [http://en.wikipedia.org/wiki/Priority_queue http://en.wikipedia.org/wiki/Priority_queue] seems to be the way to go with this.
by Autre 18y ago
A priority queue [http://en.wikipedia.org/wiki/Priority_queue http://en.wikipedia.org/wiki/Priority_queue] seems to be the way to go with this.
- mjtokelly 18y agoThis would give you the maximum weighted item, but not a weighted probability distribution.