1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| pivotNumber: 3 samllerNumbers: [ 2 ] biggerNumbers: [ 5, 44, 23, 42, 4 ]
pivotNumber: 23 samllerNumbers: [ 5, 4 ] biggerNumbers: [ 44, 42 ]
pivotNumber: 4 samllerNumbers: [] biggerNumbers: [ 5 ]
pivotNumber: 42 samllerNumbers: [] biggerNumbers: [ 44 ]
pivotNumber: 42 return [].concat([ 42 ], [ 44 ]) => [ 42, 44 ] => [ 42, 44 ]
pivotNumber: 4 return [ ].concat([ 4 ], [ 5 ]) => [ 4, 5 ]
pivotNumber: 23 return [ 4, 5 ].concat([ 23 ], [ 42, 44 ]) => [ 4, 5, 23, 42, 44 ]
pivotNumber: 3 return [ 2 ].concat([ 3 ], [ 4, 5, 23, 42, 44 ]) => [ 2, 3, 4, 5, 23, 42, 44 ]
result:[2, 3, 4, 5, 23, 42, 44]
|