i have a random number dynamic array in my code i need to filter my array. See below: link
http://tinypic.com/view.php?pic=28iwzz9&s=8#.U3881HL7Jt8 int ary[]={2 ,5,6,7,5,4,2,1 , 3 ,3,6,10,9,6,2,1 };
i need output like this : out 1: 2 , 5 , 6 , 7 , 5 , 4 , 2 , 1
out 2: 3 , 3 , 6 ,10, 9 , 6 , 2 , 1
if my array like int a[] = { 1, 2, 1, 1, 1, 3 };
out 1: 1, 2, 1, 1, 1
out 2: 3,
if my array like int a[] = { 1, 2, 1, 2, 1, 3 };
out 1: 1, 2, 1,
out 2: 2, 1,
out 3: 3,
first largest value and its surrounding value group together and so on......