Skip to content

feat(sorting):Implement in-place merge sort in Java for issue #19#37

Open
daniel-oyoo wants to merge 1 commit intoHashSlap-Summer-of-Code:mainfrom
daniel-oyoo:main
Open

feat(sorting):Implement in-place merge sort in Java for issue #19#37
daniel-oyoo wants to merge 1 commit intoHashSlap-Summer-of-Code:mainfrom
daniel-oyoo:main

Conversation

@daniel-oyoo
Copy link

Description

This PR adds a Java implementation of in-place merge sort as requested in issue #19.

Changes Made

  1. Added InPlaceMergeSort.java with complete in-place merge sort implementation
  2. Updated README.md with comprehensive documentation and complexity analysis
  3. Implementation features O(1) auxiliary space for merging as required

Key Features

  • In-place merging without additional arrays
  • O(n log n) time complexity, O(1) auxiliary space for merging
  • 7 comprehensive test cases covering edge cases
  • Detailed documentation
  • Follows project structure in `algo-and-data-structures/sorting/in-place-merge-sort/

Sample Output

Test Case 1: Unsorted Array
Input: [12, 11, 13, 5, 6, 7]
Output: [5, 6, 7, 11, 12, 13]

Issue Reference

Resolves #19
Closes #19

- Implement merge sort with O(1) auxiliary space for merging
- Time: O(n log n), Space: O(log n) recursion stack
- Add 7 test cases with edge case coverage
- Document algorithm and complexity analysis in README

Resolves HashSlap-Summer-of-Code#19
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.

🔄 Implement In-Place Merge Sort (Without Extra Array)

1 participant