May 22, 2020
This problem was solve in Java.
The problem this algorithm solves is the need to merge 2 sorted arrays together. I solved this problem as part of some homework for Data Structures I. I was pretty happy with the solution I had for this so I have included it here. Below I have some of the instructions the professor had given us for the problem.
There is no guarantee about the size of either array. When/if you run out of elements in either array, copy all the remaining elements from the nonempty array to the the new array.
You may not use any additional methods, sorting routines etc. For full credit, your solution may only go through each array one time ( so in particular - no nested loops)
I have the repo of this algorithm linked to an interactive repl. If you would like to try the code out yourself feel free to go to the repl and give it a shot. It should by default run the test cases I have written and print in the terminal below .
Name: Gary Coffey
Email: garycoffey12@gmail.com
📞: 224-266-7476