First and last Pivot element sort implemented