Doubt in "Merge sort"

It is showing run time error .When i submit the code

@76rahul257 Increase your size of temp array according to the given constraints

When i increase the size of temp array it show timelimit

@76rahul257 give input array and temp array the same size

When i take the length of temp and input array equal , It works fine when the length of array was less than 5 but when i give the length 5 and greater to the 5 it shows garbage value.!
Capture|690x311

@76rahul257 hey Rahul please share me your updated code I will update your code

@76rahul257 here is the correct one correct one

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.