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,9 @@
|
||||
new int[arr.length] inside merge(): elements allocated, and bytes measured with ThreadMXBean (MB = 1,000,000 bytes)
|
||||
====================================================================================================
|
||||
|
||||
10,000 seeded random arrays sorted by the 2015 methods vs Arrays.sort: 0 disagreements.
|
||||
|
||||
n merges int slots allocated 2015 measured one shared buffer
|
||||
1,000 999 999,000 4.0 MB 0.01 MB
|
||||
10,000 9,999 99,990,000 400.1 MB 0.04 MB
|
||||
40,000 39,999 1,599,960,000 6,400.5 MB 0.16 MB
|
||||
Reference in New Issue
Block a user