Question: Combining Arrays

Is there a way to combine Arrays, like 5 Arrays called a,b,c,d,e into a single Array? a,b,c,d and e are all the same size.

Ive been using.

A := Array(...) (whatever size I need)

for k to z do
  A[k] := a[k]
end do:


for k to z do
  A[k+z] := b[k]
end do:


for k to z do
  A[k+(2*z)] := c[k]
end do:


for k to z do
  A[k+(3*z)] := d[k]
end do:


for k to z do
  A[k+(4*z)] := e[k]
end do:
 

With z being the size of the arrays.

 

But this seems to do some weird things that maybe someone could also help me with.

I'm combining 50 Arrays of size 1 million into one Array of size 50 million.

Each individual Array has been sorted and the upper 25% point (a[750000]) is (for example in one case), 0.0679. Which differs by a max of maybe 0.001 or so for all 50 Arrays.

However when they have been combined into the one larger Array using the code above, the upper 25% point of the (sorted) large Array is something like 0.19. Which seems odd since I should be expecting a value similar to 0.0679.

If you cant figure out what I'm rambling about then consider the numbers 1-10. The upper 30% (7th) number is 7. If you repeat this list 10 times, combine them then arrange them in ascending order the upper 30% number will still be 7.

Please Wait...