Quantcast
Channel: eX-SI » arrays
Viewing all articles
Browse latest Browse all 20

ICE: Finding the array elements that occur the most frequently

$
0
0

Another example usage of Generate Sample Set instead of Repeat. This time, the problem is to find the array element with the most occurrences. This seems kinda long winded (it’s a three-step process), but it does handle the case where you have two or more elements that occur the same number of times.

FindMaxOccurrences

I used a temporary attribute for formatting purposes (so I didn’t have one big long horizontal tree). And I used a compound to encapsulate the bit that takes an array and converts it to a “per generated element” data set:
ArrayToPerElement

If you want, here’s a compound version.



Viewing all articles
Browse latest Browse all 20

Trending Articles