MathGroup Archive 2004

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

Search the Archive

Re: Re: Re: Sorting a list of pairs on the second elements


>> Both methods do the same thing at my machine,
>
> They should not when the data is actually made of Strings.

I copied from the e-mail, foolishly thinking the list was in usable InputForm.

Bobby

On Sun, 17 Oct 2004 21:49:43 -0400 (EDT), Peltio <peltio at twilight.zone> wrote:

> "DrBob" wrote
>
>> Both methods do the same thing at my machine,
>
> They should not when the data is actually made of Strings.
>
>     sss={{"ttcttgcctttgcgg","121"},...}
> and not symbols and integers as in
>     sss={{ttcttgcctttgcgg,121},...}
>
>> and there's also a third method that may do better: [snip]
>>    Reverse /@ Sort[Reverse /@ sss]
>
> I had already tried that one but it was slower than
>
>     Transpose@Reverse@Transpose@Sort@Transpose@Reverse@Transpose[
>                  sss]
>
> Mapping Reverse on every row of a long list is more time consuming than
> tranposing the matrix and swapping its *two* long rows.
> This is the side effect of working with an interpreted language, I guess.
>
> cheers,
> Peltio
> Invalid address in reply-to. Crafty demunging required to mail me.
>
>
>
>
>
>
>
>



-- 
DrBob at bigfoot.com
www.eclecticdreams.net


  • Prev by Date: Re: Corrupted file
  • Next by Date: Re: How to find out the transformation used in Mathematica
  • Previous by thread: Re: Re: Sorting a list of pairs on the second elements
  • Next by thread: Re: Re: Sorting a list of pairs on the second elements