954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Combining arrays?? Need Help

I've got 5 arrays each with one number in them, but in order to sort them using the insertion method, I need to combine them into a single array. How do I do this? This is the last part of my program and can't figure it out!

swbuko
Newbie Poster
12 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 
I've got 5 arrays each with one number in them, but in order to sort them using the insertion method, I need to combine them into a single array. How do I do this? This is the last part of my program and can't figure it out!

More details please. You want to concatenate five arrays into one? So you have an array a = {1} and an array b = {6}, you want to make an array c = {1, 6}, except there are five arrays, not two? All this prior to the sort?

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

I've got a big array of numbers called LBS[x]. It is broken up into columns like so -->

1112 10 11 12
2222 13 14 15
3332 16 17 18

swbuko
Newbie Poster
12 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

starting from the top left, my array goes as so.


group# BM Shear Torsion
LBS[0] LBS[1] LBS[2] LBS3]
LBS[4] LBS[5] LBS[6] LBS[7]
LBS[8] LBS[9] LBS[10] LBS[11]

Ultimately I need to use insertion sort, to sort the group by BM, Shear, and Torsion. Example would be we are sorting by BM, so it would look like this. LBS[5] to LBS[1] is the order.

group# BM Shear Torsion
LBS[4] LBS[5] LBS[6] LBS[7]
LBS[8] LBS[9] LBS[10] LBS[11]
LBS[0] LBS[1] LBS[2] LBS3]

swbuko
Newbie Poster
12 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

starting from the top left, my array goes as so.

group# BM Shear Torsion LBS[0] LBS[1] LBS[2] LBS3] LBS[4] LBS[5] LBS[6] LBS[7] LBS[8] LBS[9] LBS[10] LBS[11]

Ultimately I need to use insertion sort, to sort the group by BM, Shear, and Torsion. Example would be we are sorting by BM, so it would look like this. LBS[5] to LBS[1] is the order.

group# BM Shear Torsion LBS[4] LBS[5] LBS[6] LBS[7] LBS[8] LBS[9] LBS[10] LBS[11] LBS[0] LBS[1] LBS[2] LBS3]


You said you had five arrays, each with one number in it. I see one array with twelve numbers in it. Where are the five arrays?

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You