MathGroup Archive 2004

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

Search the Archive

Re: Sorting question

  • To: mathgroup at
  • Subject: [mg52782] Re: [mg52758] Sorting question
  • From: yehuda ben-shimol <benshimo at>
  • Date: Mon, 13 Dec 2004 04:22:33 -0500 (EST)
  • References: <>
  • Sender: owner-wri-mathgroup at

call your data list l
will do the work
The Cases pick up only pair of equal element and the Sort sorts them. 
The default sorting mechanism of Sort is sufficient for your needs.

Nimrod wrote:

> A simple sorting question that has me stumped as to how to do it both
>quickly and elegantly.
>I have a list of data pairs of the form (distance, time).  I want to
>sort on the distance element and then remove all pairs where the time
>element is out of order with the distance element.  For example
>((1,1),(2,3),(3,2),(4,4)) --> ((1,1),(4,4)).  The actual lists are
>much longer.
>Thanks in advnace,

  • Prev by Date: GUIKit, Mathematica 5.1
  • Next by Date: Re: multiple outputs from a function
  • Previous by thread: Sorting question
  • Next by thread: Re: Sorting question