gaurav-bhalerao-107 / python-scripts

This is a beginner level repository for python enthusiast to contribute in a hacktoberfest 2022, The aim is to make this repository a pool of script or program written in python. Make your first Pull Request on Hacktoberfest 2022. ⭐
9 stars 29 forks source link

Create MergeSort.py #9

Closed hamzaziizzz closed 2 years ago

hamzaziizzz commented 2 years ago

Merge Sort is a Divide and Conquer algorithm. It divides input array in two halves, calls itself for the two halves and then merges the two sorted halves. The merge() function is used for merging two halves. The merge(arr, l, m, r) is key process that assumes that arr[l..m] and arr[m+1..r] are sorted and merges the two sorted sub-arrays into one.