Whats wrong here please check

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

ll partisan(ll *a, ll s, ll e){

ll pivot = a[e];
ll l=-1;
ll r=0;

for(r=0;r<e;r++){
    if(a[r]<pivot){
        swap(a[++l],a[r]);
    }
}

swap(a[l+1],a[e]);

return l+1;

}

void quick_sort(ll *a, ll s, ll e){

if(s>=e){
    return;
}

ll p = partisan(a,s,e);

quick_sort(a,s,p-1);
quick_sort(a,p+1,e);

}

void random(ll *a,ll e){

srand(time(NULL));
for(int i=e;i>0;i--){
	int j = rand()%(i+1);
	swap(a[i],a[j]);
}	

}

int main(){

ll n;
cin>>n;
ll a[n];
for(ll i=0;i<n;i++)cin>>a[i];
random(a,n-1);
quick_sort(a,0,n-1);
for(ll i=0;i<n;i++)cout<<a[i]<<" ";

}

Share your code using ide.codingblocks.com and I’ll debug it for you.

Check now =>

thanks…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.