Skip to content

Merge Sort is a comparative sorting algorithm. Merge Sort divides a string into smaller pieces by first dividing it in half. It then assembles these pieces in order. This process is repeated until the subparts become a single ordered array.

Notifications You must be signed in to change notification settings

sametuca/merge-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Merge Short Algorithm

Merge Sort is a comparative sorting algorithm. Merge Sort divides a string into smaller pieces by first dividing it in half. It then assembles these pieces in order. This process is repeated until the subparts become a single ordered array.

Merge Sort is a sorting algorithm that includes the following steps:

If the array has only one element, it is considered sorted.

We split the array in the middle and split it into two parts.

We sort the subarrays by calling Merge Sort again for each fragment.

After the sub-segments are sorted, the two sub-arrays are combined. During this merging process, the elements of the two subarrays are compared and placed in the appropriate position to form a sorted array.

After all subparts are combined, the sorted array is formed.

Merge Sort has a time complexity of n log n, making it highly efficient for sorting large sized arrays. However, this efficiency can be a disadvantage in some cases because Merge Sort requires additional memory usage. Also, the algorithm is somewhat complex to implement and can take time to read and understand the code.

About

Merge Sort is a comparative sorting algorithm. Merge Sort divides a string into smaller pieces by first dividing it in half. It then assembles these pieces in order. This process is repeated until the subparts become a single ordered array.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages