Skip to content

Conversation

@KausLol
Copy link

@KausLol KausLol commented Oct 22, 2025

Description

Implemented the merge() method in the Sorter class using merge sort algorithm.

Fixes #3

Changes Made

  • Implemented Sorter.merge() method with divide-and-conquer algorithm
  • Added merge_helper() function to merge sorted sublists
  • Added merge_sort_recursive() function for recursive sorting
  • Ensured immutability so the original list is never modified

Test Results

All 12 merge sort tests passing (100%)

  • Basic sorting (ascending/descending)
  • Edge cases (empty, single element, duplicates, negatives, floats)
  • Immutability verification
  • Performance test (100,000 elements in < 0.7s)
  • Custom objects with comparators
  • Already sorted and reverse sorted lists

@lindelwa122
Copy link
Owner

@KausLol, impressive work 👏

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.

sort.merge

2 participants