N
noname
Hi,
i have a string array which 16 variables viz.,
Array2Compare()=(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16)
there is another array Array2Sort()which already contains 2^16 =65535 combinations for the above 16, viz.,
Array2Sort()
============
Array2Sort(0)=x1
Array2Sort(1)=x2
Array2Sort(2)=x14
Array2Sort(3)=x1 x14
Array2Sort(4)=x1 x10
Array2Sort(5)=x6 x8 x16
Array2Sort(6)=x13 x14 x16
Array2Sort(7)=x2 x5 x14 x16
Array2Sort(8)=x5 x9 x14 x16
Array2Sort(8)=x4 x10 x12 x13
....
....
what i want to do is take each element e.g x1, of the Array2Compare(), search it in Array2Sort(), group all x1 occurrences together in a sorted manner back to Array2Sort().
Also, simultaneously create another array which does not contain occurrences of x1 in it. see below e.g:
I want to have both the arrays grouped and sorted like this in Ascending order.
with x1 without x1
--------------------------
x1 -
x1 x2 x2
x1 x3 x3
x1 x4 x4
x1 x2 x3 x2 x3
x1 x2 x4 x2 x4
x1 x3 x4 x3 x4
x1 x2 x3 x4 x2 x3 x4
x2 -
x1 x2 x1
x2 x3 x3
x2 x4 x4
x1 x2 x3 x1 x3
x1 x2 x4 x1 x4
x2 x3 x4 x3 x4
x1 x2 x3 x4 x1 x3 x4
.....
.....
so there would be 2 sorted arrays
withX() & withoutX()
my question is:
Can the Array Array2Sort() be grouped & sorted in place without using any loops?
Has someone attempted something like this and which is very fast?
i think this is very challenging though stumped right now!
i have a string array which 16 variables viz.,
Array2Compare()=(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16)
there is another array Array2Sort()which already contains 2^16 =65535 combinations for the above 16, viz.,
Array2Sort()
============
Array2Sort(0)=x1
Array2Sort(1)=x2
Array2Sort(2)=x14
Array2Sort(3)=x1 x14
Array2Sort(4)=x1 x10
Array2Sort(5)=x6 x8 x16
Array2Sort(6)=x13 x14 x16
Array2Sort(7)=x2 x5 x14 x16
Array2Sort(8)=x5 x9 x14 x16
Array2Sort(8)=x4 x10 x12 x13
....
....
what i want to do is take each element e.g x1, of the Array2Compare(), search it in Array2Sort(), group all x1 occurrences together in a sorted manner back to Array2Sort().
Also, simultaneously create another array which does not contain occurrences of x1 in it. see below e.g:
I want to have both the arrays grouped and sorted like this in Ascending order.
with x1 without x1
--------------------------
x1 -
x1 x2 x2
x1 x3 x3
x1 x4 x4
x1 x2 x3 x2 x3
x1 x2 x4 x2 x4
x1 x3 x4 x3 x4
x1 x2 x3 x4 x2 x3 x4
x2 -
x1 x2 x1
x2 x3 x3
x2 x4 x4
x1 x2 x3 x1 x3
x1 x2 x4 x1 x4
x2 x3 x4 x3 x4
x1 x2 x3 x4 x1 x3 x4
.....
.....
so there would be 2 sorted arrays
withX() & withoutX()
my question is:
Can the Array Array2Sort() be grouped & sorted in place without using any loops?
Has someone attempted something like this and which is very fast?
i think this is very challenging though stumped right now!