Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Sort Implementation #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mukku27
Copy link
Contributor

@Mukku27 Mukku27 commented Oct 16, 2024

Merge Sort Implementation

This commit adds an implementation of the Merge Sort algorithm.

1.Merge Sort is a divide-and-conquer algorithm that recursively splits the array into two halves, sorts each half, and then merges the sorted halves back together.
2.The algorithm first divides the array into smaller subarrays by finding the midpoint and recursively calling mergeSort() on the left and right halves.
3.The merge() function is used to merge two sorted subarrays by comparing the elements from both and copying the smaller element into the original array.
4.This implementation has a time complexity of O(n log n), where n is the number of elements in the array, making it efficient for large datasets.

@panditakshay402 panditakshay402 self-requested a review October 18, 2024 08:36
Copy link
Owner

@panditakshay402 panditakshay402 left a comment

Choose a reason for hiding this comment

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

@Mukku27
Copy link
Contributor Author

Mukku27 commented Oct 19, 2024

@panditakshay402 you have approved the PR if everything looks good, I would appreciate it if you could merge the PR.

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