Nov 9, 2011, 6:12 AM
Post #1 of 3
I have got an Perl array like:
Finding the BEGINNING and ENDING positions of sequentially increasing sublists from a perl numeric array
@array = (1,2,3,4,5,6,1,2,3,4,1,2,1,2,3,4,5,6,7,8,9...............)
This numeric sequence will be always sequentially increasing, unless it encounters, The beginning of the new sequentially increasing numeric sequence.
SO in this array we get sequentially increasing many subsists.
There can be n numbers in this array and so can many sequentially increasing subsists.These sublists will always be increasingly sorted.
I want to extract the BEGINING and the ENDING positions of these subsists in the array with respect to array beginning position 0.
(1,2,3,4,5,6) BEG=0 END=5
(1,2,3,4) BEG=6 END=9
(1,2) BEG=10 END=11
(1,2,3,4,5,6,7,8,9) BEG=12 END=20