how Any efficient easy way to find the maximum list among N lists with the same length using Mathematica?
This question is a continuation of a previous thread to compare two lists with the same length:
Given two lists
Here’s my code:
Any better trick to do this?
I want to define this as a function like:
But the question is the code above cross two lines, any fix for this? Here is some code working but not that beautiful
A modification of Mr.Wizard’s approach works a few times faster.
We test the both methods with
and we get
In general, to choose a method, we should know first what kind of data we are to deal with. (lenght of lists, their number, types of numbers ). While we have a large number of short lists
however if we insert “the greatest element” :
timings close up.