Divide and conquer java example. See this article to merge two arrays in O(n) time.