yesiamrajeev / Hacktoberfest2024

Do contribute to this repository and gain experience. Happy-Hacking.
16 stars 65 forks source link

Created a merge sort code #82

Closed Navneet-J closed 1 day ago

Navneet-J commented 2 days ago

Merge Sort is a recursive sorting algorithm based on the divide-and-conquer approach. The array is divided into two halves, and these halves are recursively sorted. The mergeSort() function splits the array, and the merge() function combines two sorted subarrays back into one. It operates in O(n log n) time complexity, making it efficient for large datasets. This code takes input for the size and elements of the array from the user, sorts the array using merge sort, and then prints the sorted array. The merge process ensures the subarrays are combined in sorted order.

Navneet-J commented 2 days ago

@yesiamrajeev Please review the code and suggest necessary changes.

yesiamrajeev commented 1 day ago

Looks good!!! Great job!!