This file contains 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
package main | |
func threeWayPartitionAlgo(ints []int) { | |
intsFromLeft := 0 | |
intsFromRight := len(ints) - 1 | |
initial := ints[0] | |
cmpIndex := intsFromLeft + 1 | |
vacations := 0 | |
for intsFromLeft != intsFromRight-vacations { | |
if ints[cmpIndex] < initial { |
This file contains 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
#!/bin/bash | |
#get file name | |
number=0 | |
suffix="$( printf -- '-%02d' "$number" )" | |
while test -e "memprofile$suffix.png" || test -e "cpuprofile$suffix.png" || test -e timeprofile$suffix.txt; do | |
((++number)) | |
suffix="$( printf -- '-%02d' "$number" )" |
This file contains 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
function addRecursive(a, compute) { | |
return compute? a : (b, compute2) =>addRecursive(a + b, compute2); | |
} | |
console.log(addRecursive(1)(1)(15)(6)(10)(2, true)); //35 |