Re: how to get the longest ordered sub sequence of a list in
- To: mathgroup at smc.vnet.net
- Subject: [mg103215] Re: how to get the longest ordered sub sequence of a list in
- From: dh <dh at metrohm.com>
- Date: Thu, 10 Sep 2009 07:24:48 -0400 (EDT)
- References: <h87pgp$5gt$1@smc.vnet.net>
Hi, we can do this with intermediate variables. E.g. assume the data is in d: d = RandomInteger[10, 12] then we get an non-strict increasing sub list by: t = d[[1]]; Select[d, If[# >= t, t = #; True, False] &] the following gives a strict increasing sub list, without the first element, that we need to append later: t = d[[1]]; Select[d, If[# > t, t = #; True, False] &] Daniel a boy wrote: > how to get a (strict or not-strict)decreasing sub sequence of a list? > ---------------- > > increasing ? >
- Follow-Ups:
- Re: Re: how to get the longest ordered sub sequence of a
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Re: how to get the longest ordered sub sequence of a
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Re: how to get the longest ordered sub sequence of a