View Single Post
Old Dec 30th, 2007, 7:03 AM   #7
Klipt
Hobbyist Programmer
 
Join Date: Dec 2005
Posts: 118
Rep Power: 0 Klipt is an unknown quantity at this point
Re: Challenging Programming Problem - "Pinball Ranking"

Apart from a balanced binary tree, you could probably use a red-black tree, radix tree or skip list. I think a radix tree might be easiest...

The STL has built in red-black tree implementations for sets and maps, but unfortunately there's no fast function giving the number of elements (<x) in a multiset.

The Java TreeSet class has a tailSet function which would work perfectly, except that there is no time guarantee, and I don't know whether Java supports multisets.
Klipt is offline   Reply With Quote