Merge Sort Time and Space Complexity
Let's take this implementation of Merge Sort as an example void mergesort(Item a[], int l, int r) { if (r <= l) return; int m = (r+l)/2; mergesort(a, l, m); ------------ (1) mergesort(a, m+1, r); ------------(2) merge(a, l, m, r); a) The time complexity of this Merge Sort is O(nlg(n)). Will parallelizing (1) and (2) give any practical gain ? Theorotically, it appears that after parallelizing them also you would end up in O(nlg(n). But practically can we get any gains ? b) Space complexity of this Merge Sort here is O(n). However, if I choose to perform in-place merge sort using linked lists