Re: Sort problem
- To: mathgroup at smc.vnet.net
- Subject: [mg56307] Re: Sort problem
- From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
- Date: Fri, 22 Apr 2005 06:22:32 -0400 (EDT)
- Organization: Uni Leipzig
- References: <d47suf$54n$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, AgeSort[person : {__String}, age : {__Integer}] /; Length[person] == Length[age] := Transpose[Sort[Transpose[{age, person}], First[#1] < First[#2] &]] {pple,age}=AgeSort[pple, age]; ??? Regards Jens <konstantpi at mail15.com> schrieb im Newsbeitrag news:d47suf$54n$1 at smc.vnet.net... > Hi > How to sort two lists such as: > age={30,12,60,20}; > pple={"john","kate","peter","alice"}; > > to give the output: > age={12,20,30,60} > pple={"kate","alice","john","peter"} > > ie: to keep every person opposite his age > number. > thanks >