Re: finding the position of a pattern in list
- To: mathgroup at smc.vnet.net
- Subject: [mg64618] Re: [mg64583] finding the position of a pattern in list
- From: "Jacob A. Siehler" <siehlerj at wlu.edu>
- Date: Fri, 24 Feb 2006 00:18:13 -0500 (EST)
- References: <200602230534.AAA13180@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
> and 1. For example, {0,0,1,1,1,0,0,1,1,1,0}. I want to find the > positions of all the pattern of {0,1}. This will work, and seems to be faster than loop solutions though there is a space tradeoff. f = Random[Integer] & /@ Range[1000000]; Timing[res = Position[Partition[f, 2, 1], {0, 1}];]
- References:
- finding the position of a pattern in list
- From: Gang Ma <contactmagang@gmail.com>
- finding the position of a pattern in list