[ 
https://issues.apache.org/jira/browse/MATH-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13701618#comment-13701618
 ] 

Sebb commented on MATH-1000:
----------------------------

The commented out code was what I used originally.
I then decided that recreating the collection was likely to be more expensive 
than scanning twice.

The idea was that when the frequency of the current element is greater than the 
previously highest recorded frequency, any previously cached entries are thrown 
away because they are no longer the most popular; the collection is recreated 
with the newly found most popular element.

I left the code, just in case it would be cheaper to scan once, but recreate 
the collection.

I'll drop the set approach.
                
> Add mode function to Frequency class
> ------------------------------------
>
>                 Key: MATH-1000
>                 URL: https://issues.apache.org/jira/browse/MATH-1000
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Sebb
>         Attachments: MATH-1000.patch, MATH-1000-Test.patch
>
>
> It would be useful to have a mode function for the Frequency class

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to