partition function similar to quick sort Considers last element as pivot and adds elements with less value to the left and high value to the right and also changes the pivot position to its respective position in the final array .
function _partition ( arr , low , high ) { let pivot = arr [ high ] , pivotloc = low ; for ( let i = low ; i <= high ; i ++ ) {