//---------------------------------------------------------------------------
#ifndef estructurasH
#define estructurasH

typedef struct prods
{
  AnsiString descr;
  AnsiString imagen;
  Currency PVPmin;
  Currency PVPmax;
  Currency PVPcurr;
  int nclicks;
  int clicks;
} TProds;
//---------------------------------------------------------------------------
#define PROD_ROWS 5
#define PROD_COLS 10
//---------------------------------------------------------------------------
void partition( TProds *a[], int left, int right, int& lp, int &rp)
{
    int i = left + 1; int j = left + 1;
    TProds *x = a[left];
    while (j <= right) {
       if (a[j]->PVPcurr < x->PVPcurr) {
          TProds *temp = a[j];
          a[j] = a[i];
          a[i] = temp;
          i++;
       }
       j++;
    }
    a[left] = a[i-1];
    a[i-1] = x;
    lp = i - 2;
    rp = i;
}

void quicksort( TProds *a[], int left, int right )
{
    if (left < right) {
       int lp, rp;
       partition( a, left, right, lp, rp );
       quicksort(a, left, lp);
       quicksort(a, rp, right);
    }
}

void sort( TProds *a[], int n )
{
    quicksort(a, 0, n-1);
}
//---------------------------------------------------------------------------


#endif 