Add quick-sort module: Lomuto and Hoare partition dry runs, comparison/swap/depth counts on sorted, reverse and all-equal input, random pivot, three-way partition, recursion into the smaller side, and the three 2015 programs re-run (one corrupts duplicates, one throws) (16 tests, 14 transcripts)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b7Rercfj3dzDQowoFA
This commit is contained in:
Claude
2026-11-25 22:58:21 +05:30
parent 515302d5ba
commit 6e5764978f
40 changed files with 1765 additions and 0 deletions
@@ -0,0 +1,10 @@
The 2015 temp-array version (post 2559): fine on distinct keys, corrupts duplicates
===================================================================================
distinct keys [15, 32, 45, 25, 34, 29, 14] -> [14, 15, 25, 29, 32, 34, 45] (correct)
duplicates [3, 1, 3, 2] -> [1, 2, 3, 0] (expected [1, 2, 3, 3])
the second 3 was never copied into temp[]; the leftover slot kept its initial 0.
10,000 seeded random arrays (length 2..8, keys 1..9): 6,479 contained a duplicate; 6,479 came back wrong.
every wrong answer was an array with a duplicate; no array of distinct keys came back wrong.