class Rank { param { Array < number > } . . a static insert ( [ ... a ] ) { var key , j ; for ( var i = 2 ; i <= a . length ; i ++ ) { key = a [ i ] ; j = i - 1 ; while ( i > 0 && a [ j ] > key ) { a [ j + 1 ] = a [ j ] ; j = j - 1 ; a [ j + 1 ] = key ; } } return a ; } param { Array < number > } . . a return { Array < number > } static bubbleSort ( [ ... a ] ) { let temp = 0 ; for ( let i = 0 ; i < a . length - 1 ; i ++ ) { for ( let j = 0 ; j < a . length - i ; j ++ ) { if ( a [ j ] > a [ j + 1 ] ) { temp = a [ j ] ; a [ j ] = a [ j + 1 ] ; a [ j + 1 ] = temp ; } } } return a ; } static SelectSort ( ) { } static quickSort ( [ ... arry ] , begin , end ) { var i = begin , j = end , key = arry [ begin ] ; while ( i < j ) { while ( i < j && arry [ j ] >= key ) j -- ; if ( i < j ) { arry [ i ] = arry [ j ] ; i ++ ; } while ( i < j && arry [ i ] < key ) i ++ ; if ( i < j ) { arry [ j ] = arry [ i ] ; j -- ; } } arry [ i ] = key ; Rank . quickSort ( arry , begin , i - 1 ) ; Rank . quickSort ( arry , i + 1 , end ) ; return arry ; } } export { Rank } ;