function swap(array, i1, i2)
        {
            var temp = array[i1];
            array[i1] = array[i2];
            array[i2] = temp;
        }
@this {Array.<number>}
@param {function(number, number): number} comparator
@param {number} left
@param {number} right
@param {number} pivotIndex