6.23 Testing Sort Correctness
6.23 Testing Sort Correctness Sorting implementations are easy to get almost right and hard to get completely correct. Subtle bugs often appear only on edge cases, duplicate-heavy inputs, or adversarial patterns. A disciplined testing strategy verifies both the ordering and permutation properties under a wide range of inputs. Problem You have implemented a sorting algorithm. You want to verify that it is correct, stable when required, and robust across inputs....