Merge Sort
How do you implement a merge sort
1. break the array in half into a left array and right array 2. continue breaking up until you have atomic elements 3. use a merge algorithm and auxiliary array to bring the elements together using a comparison operation to determine which elements should be in a new position
What is the space complexity of merge sort
O(n)
What is the time complexity of merge sort
O(nlogn)
Is merge a stable algorithm
it can be depending on how the comparison is done when it reach atomic elements that are equal to each other
What is merge sort
merge sort is a divide and conquer based approach to sorting an algorithm. it is a recursive algorithm that involves breaking up the original array to the smallest possible piece and then merging it based off which piece is bigger or smaller
which elements of the merge sort algorithm are recursive
the breaking up of the orignal array into subarrays