Kaos
The program should connect 2 sorted arrays into 1 sorted array
You can shorten the body of the if/else incrementing to be like my while statements, or expand the while statement, but they should be consistent either way. If you have any questions, feel free to ping
10 replies
The program should connect 2 sorted arrays into 1 sorted array
since I know that the a index and the b index are going to be less than C's length, I can break as soon as one of those is finished. Then I can add whatever the remaining one has left in it. If A is exhausted, then aIndex < A.Length will be false and that else will be skipped. Then it will add the rest of what is in B.
10 replies