BlastHardcheese 1339287581 learn swap(){ local t;t=${a[$1]};a[$1]=${a[$2]};a[$2]=$t;};partition(){ local c p x;p=${a[$3]};c=$1;swap "$2" "$3";for((x=$1;x<$2;x++));do if((${a[x]}<$p));then swap "$x" "$c";((c++));fi;done;swap "$2" "$c";n=$c;};quicksort(){ if(($1>=$2));then return;fi;local i n;i=$((($1+$2)/2));partition "$1" "$2" "$i";quicksort "$1" "$((n-1))";quicksort "$((n+1))" "$2";}; # usage: quicksort start end; a is the contiguous array to so BlastHardcheese 1339287657 forget BlastHardcheese 1339287665 learn swap(){ local t;t=${a[$1]};a[$1]=${a[$2]};a[$2]=$t;};partition(){ local c p x;p=${a[$3]};c=$1;swap "$2" "$3";for((x=$1;x<$2;x++));do if((${a[x]}<$p));then swap "$x" "$c";((c++));fi;done;swap "$2" "$c";n=$c;};quicksort(){ if(($1>=$2));then return;fi;local i n;i=$((($1+$2)/2));partition "$1" "$2" "$i";quicksort "$1" "$((n-1))";quicksort "$((n+1))" "$2";}; #usage: quicksort start end; a is array to sort