The only catch there as I remember is the need to know the smallest
element -- but also the need to limit the size and therefore know the
largest element too. So I think that's why I couldn't use the data
structure. I could be missing something.
On Thu, Nov 6, 2008 at 10:47 PM, Otis Gospodnetic
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I see this in the NearestNUserNeighborhood:
>
> ListIterator<UserCorrelationPair> iterator =
> queue.listIterator(queue.size());
> while (iterator.hasPrevious()) {
> if (theCorrelation <= iterator.previous().theCorrelation) {
> iterator.next();
> break;
> }
> }
>
> This looks like a priority queue.... if so, I wonder if it would be clearer
> to just use the java.util.PriorityQueue or maybe even a variation of the one
> in Lucene? Not sure if there's a need for this change, just thinking our
> loud as I browse Taste code.
>
> Oh, I see Hadoop has its own PQ, too:
>
> http://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/util/PriorityQueue.html
> which seems to be a slightly modified variation of the Lucene version:
>
> http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc/org/apache/lucene/util/PriorityQueue.html
>
> Otis
> --
> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
>
>