Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Implement Merge Sort

Given a list of numbers, your task is to sort it using Merge Sort algorithm. Example: Input: [ 5, 8, 3, 9, 4, 1, 7 ] Output: [ 1, 3, 4, 5, 7, 8, 9 ] Notes: Constraints: 1 <= Length of the array <= 4*105. -109 <= Any number in the array <= 109. Custom Input: Input Format: The first line contains the length of the input array. The numbers in the array are then given in separate lines. Input for “Example” above would be: 7 5 8 3 9 4 1 7 Output Format: The output contains the sorted version of the input array. Each number is given in a separate line. Output for “Example” above would be: 1 3 4 5 7 8 9