Skip to content

Add Merge Sort implementation in C#214

Merged
Pradeepsingh61 merged 2 commits intoPradeepsingh61:mainfrom
Abhi8756:feature/merge-sort-c
Oct 1, 2025
Merged

Add Merge Sort implementation in C#214
Pradeepsingh61 merged 2 commits intoPradeepsingh61:mainfrom
Abhi8756:feature/merge-sort-c

Conversation

@Abhi8756
Copy link
Contributor

@Abhi8756 Abhi8756 commented Oct 1, 2025

📋 Pull Request Description

What does this PR add?

  • New algorithm implementation
  • Data structure implementation
  • New programming language support
  • Language-specific README
  • Bug fix
  • Documentation improvement
  • Test cases

Algorithm/Feature Details

  • Name: Merge Sort
  • Language: C
  • Category: Sorting Algorithms
  • Time Complexity: O(n log n) for all cases
  • Space Complexity: O(n) for temporary arrays

Testing

  • Code compiles without errors (syntax verified)
  • All test cases covered in main function
  • Edge cases handled (invalid input, empty arrays)
  • Documentation updated with comprehensive comments

Algorithm Features

  • Divide-and-conquer approach: Recursively divides array into halves
  • Stable sorting: Maintains relative order of equal elements
  • Consistent performance: O(n log n) for best, average, and worst cases
  • Memory management: Proper malloc/free for temporary arrays
  • Interactive input: User can enter custom array to sort
  • Comprehensive output: Shows original vs sorted array plus algorithm info

Additional Notes

  • Follows repository's C coding style (matches selection_sort.c format)
  • Uses dynamic memory allocation for temporary arrays during merge process
  • Includes proper error handling for invalid input
  • Algorithm information displayed to educate users about complexity
  • Clean, readable C code with detailed comments explaining the divide-and-conquer process
  • Implements both merge() helper function and recursive mergeSort() function

Hacktoberfest 2025

This contribution is part of Hacktoberfest 2025 participation. Merge sort was missing from the C sorting algorithms collection and is a fundamental algorithm that demonstrates divide-and-conquer methodology.

@github-actions
Copy link

github-actions bot commented Oct 1, 2025

🎉 Welcome to Hacktoberfest 2025, @Abhi8756! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Passed
  • 🧪 Compilation Tests: Passed

📋 Next Steps

🎯 Great job! Your code compiled successfully. Maintainers @Karanjot786 and @Pradeepsingh61 will review your PR soon.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions github-actions bot requested a review from Karanjot786 October 1, 2025 13:31
@github-actions
Copy link

github-actions bot commented Oct 1, 2025

🤖 Automated PR Status

🔍 Code Validation

Passed - File naming and structure look good!

🧪 Compilation Tests

Passed - All code compiles successfully!

📋 Overall Status

🎉 Ready for Review - Your PR has passed all automated checks!
👥 Maintainers have been notified for review.


This comment was generated automatically. Checks will re-run when you push new commits.

Copy link
Collaborator

@Karanjot786 Karanjot786 left a comment

Choose a reason for hiding this comment

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

it is good @Pradeepsingh61 now you can merge it

@Pradeepsingh61 Pradeepsingh61 merged commit 91aef43 into Pradeepsingh61:main Oct 1, 2025
1 check passed
@github-actions
Copy link

github-actions bot commented Oct 1, 2025

🎉 Welcome to Hacktoberfest 2025, @Abhi8756! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Passed
  • 🧪 Compilation Tests: Passed

📋 Next Steps

🎯 Great job! Your code compiled successfully. Maintainers @Karanjot786 and @Pradeepsingh61 will review your PR soon.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions github-actions bot requested a review from Karanjot786 October 1, 2025 14:38
@github-actions
Copy link

github-actions bot commented Oct 1, 2025

🤖 Automated PR Status

🔍 Code Validation

Passed - File naming and structure look good!

🧪 Compilation Tests

Passed - All code compiles successfully!

📋 Overall Status

🎉 Ready for Review - Your PR has passed all automated checks!
👥 Maintainers have been notified for review.


This comment was generated automatically. Checks will re-run when you push new commits.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants