[
https://issues.apache.org/jira/browse/METRON-1405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16329142#comment-16329142
]
ASF GitHub Bot commented on METRON-1405:
----------------------------------------
Github user ottobackwards commented on the issue:
https://github.com/apache/metron/pull/899
@Test
public void boyerMoore_calculates_plurality_from_list_of_values_o()
throws Exception {
List<Integer> items = Arrays.asList(1, 1, 1,1, 2,2,3,3,4,4,4);
BoyerMooreState state = null;
for (Integer item : items) {
state = (BoyerMooreState) new
BoyerMooreAdd().apply(Arrays.asList(state, item));
}
Assert.assertThat(new
BoyerMoorePlurality().apply(ImmutableList.of(state)), CoreMatchers.equalTo(1));
}
as well
> Add Boyer-Moore majority vote algorithm to Stellar
> --------------------------------------------------
>
> Key: METRON-1405
> URL: https://issues.apache.org/jira/browse/METRON-1405
> Project: Metron
> Issue Type: New Feature
> Reporter: Michael Miklavcic
> Assignee: Michael Miklavcic
> Priority: Major
>
> A proper majority calculation requires 2 passes, however a simple plurality
> can be calculated using a single pass.
> https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_majority_vote_algorithm
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)