Merge Sort

Advanced Sorting Algorithms DSA practice problem on Onlearn.

Difficulty: medium.

Topics: Sort an array using Merge Sort, Sorting, Merge Sort, Divide and Conquer, Recursion, Arrays, Time Complexity, Space Complexity, space complexity, sorting algorithms, array manipulation, divide and conquer, merging sorted structures, recursion, time complexity analysis, Merge Sort, Merging Sorted Data.

Sort an Array using Merge Sort Problem Statement Given an array arr of size N, sort the array using the Merge Sort algorithm. Input Specification The first line contains an integer N, the size of the array. The second line contains N space separated integers, representing the elements of the array arr. Output Specification Print the sorted array elements separated by spaces. Constraints 1 <= N <= 10^5 10^9 <= arr[i] <= 10^9 Sample Test Cases Example 1: Example 2: