快速排序 练手
package Algorithm ; public class Day1218 { public static void quickSort ( int [ ] arr , int low , int high ) { if ( low >= high ) { return ; } int key = arr [ low ] , temp ; int start = low , end = high ; while ( start < end ) { while ( start < end && key <= arr [ end ] ) { end -- ; } if ( start < end ) { temp = arr [ end ] ; arr [ end ] = arr [ start ] ; arr [ start ] = temp ; } while ( start < end && key >= arr [ start ] ) { start ++ ; } if ( start < end ) { temp = arr [ end ] ; arr [ end ] = arr [ start ] ; arr [ start ] = temp ; } } //这时候start和end是一样的,指向同一个数 quickSort ( arr , low , start -