Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Implement the merge sort algorithm to sort an array

Hard

Problem Statement

Implement the merge sort algorithm to sort an array

Sample Input

[12, 11, 13, 5, 6, 7]

Sample Output

[5, 6, 7, 11, 12, 13]

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
import java.util.*; public class Main { public static void mergeSort() { int[] arr = {12, 11, 13, 5, 6, 7}; // Your code here } }
Log in or sign up to run or submit your code.Log inSign up
Input
[12, 11, 13, 5, 6, 7]
Expected Output
[5, 6, 7, 11, 12, 13]