Stable sort Before sorting [2, 9, 3, 4, 1, 5, 8, 1, 4, 8, 7, 6] After sorting [1, 1, 2, 3, 4, 4, 5, 6, 7, 8, 8, 9] Unstable sort Before sorting [2, 9, 3, 4, 1, 5, 8, 1, 4, 8, 7, 6] After sorting [1, 1, 2, 3, 4, 4, 5, 6, 7, 8, 8, 9]