about | help | code help+videos | done | prefs |
mergeSortedArrays
The normal mergeSort algorithm splits an array into two halves and mergeSorts each half. Then, it takes those two sorted halves and merges them together. This focuses on the part of the algorithm that merges two already sorted arrays into one big array. Given two sorted arrays of ints, return an array that merges these two arrays together into one sorted array. Arrays need not be the same length, and either or both arrays could be empty. mergeSortedArrays([1, 7], [2, 50]) → [1, 2, 7, 50] mergeSortedArrays([10], [4, 7, 15, 99, 200]) → [4, 7, 10, 15, 99, 200] mergeSortedArrays([27, 27], []) → [27, 27] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy