template<class T> void sSort(T *A, int first, int last)
{
if(A[first]>A[last])
swap(A[first],A[last]);
if(first+1>=last)
return;
double k = floor((last-first+1)/3);
sSort(A,first,last-k);
sSort(A,first+k,last);
sSort(A,first,last-k);
}
I perfectly understood the mergeSort, bubbleSort complexities but i'm so confused in this one. What is the complexity for this algorithm. Can anyone explain?