Give two sorted arrays A and B develop a function to generate a new sorted array C that consists of elements strictly from A and B alternatively, i.e., if A-[1,4,5), B-(2,6), then C-[1,2,4,6); if A=[5,6], B=(2,4), then C-15). Your code should handle all possible cases that may arise.