Hi,
that's far from trivial even in pur c#.
you'll need to have a buffer that assigns a weight for each value you find in arrays over time, and then as time goes by, the weight of the most occuring values will increase, and thus you'll be able to sort values by weight and get what's most occuring this way.
I would start working on this with two arrays ( using fsmArray), or ArrayList ( using ArrayMaker), one array will represent the value, the other the weight, both array need to be maintain in sync, by their indexes. so index 3 on the first array will be the value, and index 3 on the second array will be the associated weight for that value.
Everytime your array changes or whenever you want to take a snapshot of the values to weight them, go over that array, find the index of that value in the values, if not add it, and increase the related weight by 1.
after you took several snapshots, reoccuring values will have their weight higher then others, if you want to get the highest occuring value:
1: copy the weight array into another array
2: sort that array from highest to lowest
3: get the weight value of the first item ( item 0)
4: find the index of the weight in the weights array
5: get the value from the index in the values array -> that's your highest occuring value
so indeed... not trivial at all, but doable with some patience
Bye,
Jean