export class Sort24 { static param { any [ ] } list return { any [ ] } memberof static _Normal ( list ) { return list . concat ( ) ; } static param { any [ ] } list return { any [ ] } memberof static _Reverse ( list ) { return list . concat ( ) . reverse ( ) ; } static param { any [ ] } list return { any [ ] } memberof static _Valley ( list ) { const result = [ ] ; const original = list . concat ( ) ; while ( original . length ) { if ( original . length >= 2 ) result . push ( [ original . shift ( ) , original . pop ( ) ] ) ; else result . push ( [ original . shift ( ) ] ) ; } return result ; } static param { any [ ] } list return { any [ ] } memberof static _Mountain ( list ) { const result = [ ] ; const half = Math . round ( list . length / 2 ) ; const list1 = list . slice ( 0 , half ) ; const list2 = list . slice ( half ) ; if ( list1 . length != list2 . length ) result . push ( list1 . pop ( ) ) ; while ( list1 . length ) { result . push ( [ list1 . pop ( ) , list2 . shift ( ) ] ) ; } return result ; } static param { any [ ] } list return { any [ ] } memberof static _Shuffle ( list ) { const result = list . concat ( ) ; for ( let i = result . length - 1 ; i >= 0 ; i -- ) { const j = Math . floor ( Math . random ( ) * ( i + 1 ) ) ; [ result [ i ] , result [ j ] ] = [ result [ j ] , result [ i ] ] ; } return result ; } static param { any [ ] } list return { any [ ] } memberof static _EvenAndOdd ( list ) { const evn = [ ] ; const odd = [ ] ; for ( let i = 0 ; i < list . length ; i ++ ) { if ( i % 2 ) odd . push ( list [ i ] ) ; else evn . push ( list [ i ] ) ; } return [ evn , odd ] ; } }