Re: Use pattern to find minimum without using min
- To: mathgroup at smc.vnet.net
- Subject: [mg71854] Re: Use pattern to find minimum without using min
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 1 Dec 2006 06:22:06 -0500 (EST)
- Organization: Uni Leipzig
- References: <ekmdbc$7th$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi, {9, 4, 6, 5, 3, 7} //. {{x_, y_, z___} :> {x, z} /; (x < y), {x_, y_, z__} :> {y, x, z}} ?? Regards Jens wooks wrote: > Tried > > {9, 4, 6, 5, 3, 7} //. {a___, b_, c___, d_, e___} :> b /; (b < d) > > and > > {9, 4, 6, 5, 3, 7} //. {x_,y_,z___} :> {x,z} /; (x<y) > > without much success. >