Skip to content

Conversation

@Ramy-Badr-Ahmed
Copy link
Member

@Ramy-Badr-Ahmed Ramy-Badr-Ahmed commented Sep 9, 2024

Desciption:

This pull request introduces an implementation of the Merge Sort algorithm.

Definition:

  • Merge Sort is a classic divide-and-conquer algorithm used for efficiently sorting arrays.
  • The algorithm recursively divides the input array into two halves, sorts each half, and then merges the two sorted halves into a single sorted array.
  • This algorithm is known for its stable sort and predictable O(n log n) time complexity.

Implementation Details:

merge_sort.f90: Contains the merge_sort_module with:

merge_sort: A recursive subroutine that sorts the input array.
merge: A subroutine that merges two sorted arrays into a single sorted array.

The implementation follows the module structure as outlined in the contribution guidelines.

Example Usage:

example_usage_merge_sort.f90: A test program that demonstrates the merge_sort subroutine from the merge_sort_module. It sorts a sample array and prints the results.


Reference

The Algorithm Design Manual, Latest edition

@Ramy-Badr-Ahmed
Copy link
Member Author

Hi @SatinWukerORIG,
Looking forward to your review 🙂

Copy link
Member

@SatinWukerORIG SatinWukerORIG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SatinWukerORIG SatinWukerORIG merged commit acfd9b4 into TheAlgorithms:main Sep 12, 2024
@Ramy-Badr-Ahmed
Copy link
Member Author

Thanks, @SatinWukerORIG

Looking forward as well to your review for:
#9 , #10 , #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants