Segmentation error in merge sort
Hey Simran, as mergesort() is recursive function so its necessary to put the base case also, you haven’t written the base case. one more thing is while calling mergesort() from main() pass the start index as 0 and end index as n-1, because in arrays indexing starts from 0 and ends at size-1.
I’ve made the changes, please check https://ide.geeksforgeeks.org/6O1cnDrRbL
I’m getting garbage values in the output