1. Should use "j" to not "i" to access an element of the array; 2. Should use (a, b) = (b, a) to swap; 3. Regression test is required.