MathGroup Archive 2007

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

Search the Archive

Custom sort a list of pairs

  • To: mathgroup at
  • Subject: [mg73633] Custom sort a list of pairs
  • From: planetmarshalluk at
  • Date: Fri, 23 Feb 2007 04:41:55 -0500 (EST)

Hi there,

I've searched through existing posts to no avail, what I want to do is
Sort a nested list of pairs, so that each pair is sorted by reverse
canonical order on its first element, and in normal order on its
second element.

For example, I want some function


that when given the input

{{ 1,a},{2,a},{3,a},{1,b},{2,b},{1,c}}

produces the output


Any help much appreciated.


  • Prev by Date: Re: mouse wheel with Mathematica on Linux
  • Next by Date: Fuction definition
  • Previous by thread: Re: Help with Reduce Command.
  • Next by thread: Re: Custom sort a list of pairs