Add merge-sort module: top-down and bottom-up merge sort, dry runs, stability, comparison counts against the exact worst case, linked lists, counting inversions, quick sort and TimSort comparisons, and the 2015 program re-run (unstable on ties, quadratic allocation) (17 tests, 15 transcripts)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6vDJ5fWY5uEZaJFNi
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
Sorting students by marks only: equal marks should keep their input order
|
||||
=========================================================================
|
||||
|
||||
input [Asha:82, Bala:75, Chitra:82, Dev:75, Esha:90]
|
||||
ties take LEFT (cmp <= 0) [Bala:75, Dev:75, Asha:82, Chitra:82, Esha:90]
|
||||
Arrays.sort(T[], Comparator) [Bala:75, Dev:75, Asha:82, Chitra:82, Esha:90]
|
||||
ties take RIGHT (cmp < 0) [Dev:75, Bala:75, Chitra:82, Asha:82, Esha:90] <- the 2015 rule: not stable
|
||||
Reference in New Issue
Block a user