If you're looking for the mode of a set and you've been handed the set (meaning you weren't involved in building it) then you're going to have to iterate over each element and count. There's a quantum algorithm to do this more quickly, but the tech isn't there yet.
Why can't the elements be "put as a dictionary to set counters against them"? That's going to be the solution that most people hear will drive you towards. If you can't directly $count{thing}++ then you're going to have to $count{stringify(thing)}++ and find the mode(s) afterward.
In reply to Re: find maximum occuring element in a array
by AR
in thread find maximum occuring element in a array
by capriguy84
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |