Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7Rercfj3dzDQowoFA
17 lines
632 B
Plaintext
17 lines
632 B
Plaintext
Lomuto vs Hoare on random distinct-ish keys (seed 7)
|
|
====================================================
|
|
|
|
n scheme comparisons swaps
|
|
1,000 LOMUTO_LAST 10,128 4,547
|
|
1,000 HOARE_MIDDLE 15,679 2,301
|
|
Hoare used 0.51x the swaps of Lomuto
|
|
|
|
10,000 LOMUTO_LAST 155,168 66,283
|
|
10,000 HOARE_MIDDLE 193,958 30,750
|
|
Hoare used 0.46x the swaps of Lomuto
|
|
|
|
100,000 LOMUTO_LAST 2,050,086 1,016,714
|
|
100,000 HOARE_MIDDLE 2,377,190 387,156
|
|
Hoare used 0.38x the swaps of Lomuto
|
|
|