In this video lesson we will study how the Merge Sort algorithm works, we will analyze its time and space complexities and then we will implement it:
Problem - Merge Sort:
Given an array of integers nums, sort it in ascending order using Merge Sort
Example 1:
Input: nums =[3, 1, 3, 2, 5, 4]Output:[1, 2, 3, 3, 4, 5]
Note:
Your algorithm should run in O(n log n) time and use O(n) extra space.
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check