Quicksort Algorithm

Start with an array A with elements to n-1.

Call quicksort( data, 0, data.size() - 1 ) to sort all elements from to n-1.

void quicksort( vector<int> & data, int start, int end )
{
  if( start < end )
  {   
    int boundary = partition( data, start, end, start );
    quicksort( data, start, boundary-1 );
    quicksort( data, boundary + 1, end );
  }
}


next up previous
Next: Partition Up: PROBLEM WITH QUICKSORT Previous: Review