What is Merge Sort? Merge sort is a divide-and-conquer method that sorts an array by splitting it into half recursively…