ll partition(ll *a,ll s,ll e)
{
ll i=s-1;
ll j=s;
ll pivot=a[e];
for(;j<=e-1;j++)
{
if(a[j]<=pivot)
{
i++;
swap(a[i],a[j]);
}
}
swap(a[i+1],a[j]);
return i+1;
}
in partition loop why we run loop from j=s to e-1 and not e?
what will be the problem if we run j<=e instead of j<=e-1.
Thank you.