- #1
scumbum22
- 6
- 0
I'm working on programming my own sorting code in C++ using the divide and conquer algorithm. I'm a novice programmer and I've gotten a little stuck.
Let's say you begin your code with an array of distances,
dis[4] = {dis1, dis2, dis3, dis4}
Then I want to separate this array into subarrays. I have the following,
for (i = 0, i = 4, ++i);
if (dis <= dis[0]) { ...?
}
else { ... ? }
I want to somehow make two arrays: One made up of the elements less than or equal to dis[0] and another made up of the elements not following the condition. How should I do this?
Also, is there a way to merge a string of arrays into one array?
Let's say you begin your code with an array of distances,
dis[4] = {dis1, dis2, dis3, dis4}
Then I want to separate this array into subarrays. I have the following,
for (i = 0, i = 4, ++i);
if (dis <= dis[0]) { ...?
}
else { ... ? }
I want to somehow make two arrays: One made up of the elements less than or equal to dis[0] and another made up of the elements not following the condition. How should I do this?
Also, is there a way to merge a string of arrays into one array?