This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // this gist assumes lodash or underscore is installed in order to shuffle the array for testing purposes | |
| function quickSort (arr) { | |
| console.info('step: ', arr); | |
| if(arr.length <= 1) return arr; | |
| // find middle point of array | |
| var swapPosition = Math.floor((arr.length -1) / 2); | |
| var swapValue = arr.splice(swapPosition, 1) | |
| var left = []; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /* | |
| When you break out of a nested for loop do you break out of both loops? Or just the inner one? | |
| If you want to run this, you will need the colors npm module. | |
| */ | |
| const colors = require(`colors`) | |
| for(let i = 0; i < 10; i++) { | |
| console.log(`i: ${i}`.green); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | zip ../filename.zip -r * .[^.]* | 
NewerOlder