MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Maximum in a list


> Suppose a list
>
> mylist={{1,2},{3,4},{8,3}}
>
> I would like to extract the element {i,j} of mylist for which j is max
> (here, it is the second one {3,4}).
>
> Somebody could help me, please?
>
> Pacotomi
>

mylist = {{1, 2}, {8, 3}, {3, 4}}

First[Sort[mylist, #1[[2]] > #2[[2]] & ]]

{3,4}

--Nasser 



  • Prev by Date: Re: Bug in Pattern Matching with Condition?
  • Next by Date: Re: Maximum in a list
  • Previous by thread: Re: Maximum in a list
  • Next by thread: Re: Maximum in a list