Re: Sorting a list of pairs on the second elements
- To: mathgroup at smc.vnet.net
- Subject: [mg51450] Re: Sorting a list of pairs on the second elements
- From: koopman at sfu.ca (Ray Koopman)
- Date: Sun, 17 Oct 2004 21:49:40 -0400 (EDT)
- References: <cklmi7$f1o$1@smc.vnet.net> <200410150647.CAA05265@smc.vnet.net> <ckqmu1$nf5$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
János <janos.lobb at yale.edu> wrote in message news:<ckqmu1$nf5$1 at smc.vnet.net>... > [...] the data I had to sort got so big that I even did not get to > that point to able to sort because the Kernel just quitted on me > half way. Assuming you can get your data into memory, would you be satisfied with an ordered list of pointers? With the requirement that the list members are to be ordered in terms of their kth elements, Sort[Range[Length[list]], OrderedQ[{list[[#1,k]],list[[#2,k]]}]&] should give the same as Ordering[list, All, OrderedQ[{#1[[k]],#2[[k]]}]&] without creating a second copy of list. (Or maybe Ordering already does it that way?)
- References:
- Re: Sorting a list of pairs on the second elements
- From: "Peltio" <peltio@twilight.zone>
- Re: Sorting a list of pairs on the second elements