#include
int partition(int a[],int s,int e){
int p=a[e];
int i=s-1;
int j=s;
while(j<e){
if(a[j]>p){
j++;
}
else if(a[j]<=p){
i++;
swap(a[i],a[j]);
j++;
}
}
swap(a[i+1],a[e]);
return i+1;
}
void quickSort(int a[],int s,int e){
if(s<=e){
return ;
}
int p=partition(a,s,e);
quickSort(a,s,p-1);
quickSort(a,p+1,e);
}
using namespace std;
int main() {
int n;
cin>>n;
int a[n];
for(int i =0; i<n;i++){
cin>>a[i];
}
quickSort(a,0,n-1);
for(int i=0;i<n;i++){
cout<<a[i];
}
return 0;
}
in this code of quick sort its giving error that swap is not definrd in this scope why??