Programmings›Algorithm Cookbook›Chapter 6. Sorting6.24 Common BugsIdentify boundary errors, broken invariants, and comparator mistakes that cause sorting implementations to fail on edge cases or duplicate-heavy inputs.