Menu
Coddy logo textTech

Merge Sort

Lesson 1 of 3 in Coddy's Interview Coding Challenges - Pack I course.

challenge icon

Challenge

Easy

Write a function named mergeSort that gets two sorted lists as input, merges them into one sorted list, and returns it.

For Example,

Input:

[1, 4, 6, 8, 14, 23]

[2, 3, 5, 7, 11, 18, 19, 20]

Expected Output:

[1, 2, 3, 4, 5, 6, 7, 8, 11, 14, 18, 19, 20, 23]

Try it yourself

int* mergeSort(int* a1, int a1Size, int* a2, int a2Size, int* returnSize) {
    // Write code here
}

All lessons in Interview Coding Challenges - Pack I