I've never coded a merge array function using a for loop. Usually use two while loops (one for the main part, and one for the longer array "leftovers").
Looking at this, it seems inefficient to...
Type: Posts; User: Adak
I've never coded a merge array function using a for loop. Usually use two while loops (one for the main part, and one for the longer array "leftovers").
Looking at this, it seems inefficient to...
You are right on both accounts, iMalc!
OK, here we go. I changed your code a lot, but tried to keep it in the same framework.
As iMalc sagely mentioned, we need separate indexes for each of...
You have to do two things when you make your if() comparison of apples:
1) put the smaller apple into the merged bowl and
2) pick up the smallest apple in the same bowl that was the source for...
You have 4 apples in one bowl, sorted by size. You have 4 apples in another bowl, sorted by size. You are going to put all the apples into one bowl, sorted by size.
How'd you do that?
Probably...