## 交换排序

### 快速排序

a[i] = a[j] 3(i) 0 9 8 1 4 6 3(j) 7 5
a[j] = a[i] 3 0 9(i) 8 1 4 6 9(j) 7 5
a[i] = a[j] 3 0 4(i) 8 1 4(j) 6 9 7 5
a[j] = a[i] 3 0 4 8(i) 1 8(j) 6 9 7 5
a[i] = a[j] 3 0 4 1(i) 1(j) 8 6 9 7 5
a[j] = a[i] 3 0 4 1 1(i,j) 8 6 9 7 5
a[i] = key 3 0 4 1 5(i,j) 8 6 9 7 5

a[0] a[1] a[2] a[3]
3 0 4 1
a[0] a[1] a[2] a[3] a[4]
8 6 9 7 5