Posts: 260
Threads: 0
Joined: Oct 2008
Hi,
As you, I am trying to solve most of the Euler's Problems by using only vintage system.
I see nothing wrong with your roundabout to found the most frequent value from a list (statistical mode).
What’s trigger me is why are you saying that you have to seek the most frequent perimeter value in a list of as much as 325 elements when 190 only is enough.
How are you building this list of 325 elements? Is there no way to detect the most frequent value (statistical mode) during the building process?
In my code, I use one array (counting array) to record occurrences of each perimeter. No need to record perimeter elsewhere, since the index of this counting array gives the perimeter value (since only integer values are valid for this exercise). I simply have to track the max value position in this counting array to get the answer immediately at the end of the list building process.
Edited: 29 July 2011, 3:33 a.m.