Partition function which will partition the array and into two parts
function partition ( objects , l , r , hash ) { let j = l - 1 ; let last_element = hash . get ( objects [ r ] ) ; for ( let i = l ; i < r ; i ++ ) {