Given 2 sorted arrays A and B, merge them into a third array called result.
Example
A[] : {1, 3, 5, 7}
B[] : {2, 4, 6, 8}
result[] : {1, 2, 3, 4, 5, 6, 7, 8}
A[] : {1, 4, 5, 6, 9}
B[] : {2, 3, 8}
result[] : {1, 2, 3, 4, 5, 6, 8, 9}
Questions
- Can we consider we array to be an array of integers OR floats?
- Can we assume that the resultant 3rd array is an altogether separate array than A[ ] and B[ ]? And the array result[ ] can contain spaces which is equal to A.length + B.length?
- Any specific edge cases - Range of numbers in arrays A and B?
- Assumption - Both the arrays A and B are sorted.