Are there any edge cases or just cases in general that I need to test for this function. The only thing I can think of is if one of the arrays being merged is empty. Are there other test cases I need to consider?
For any sort, I consider these cases:
This is not just to prove the algorithm but also for performance.
Some more:
Think about the number of elements in each array: Both array have even number of elements One array has even while the other has odd number of elements Number of elements in one array is more than the number of elements in another
Also consider the range of elements in the array The largest element in one array is smaller than the smallest element in the second array One array has duplicates Both the arrays have the same set of elements e.g.(A1: 2,4,6,8 and A2: 2,4,6,8)
Basically these ones are good at catching one off errors in the for loop while merging
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With