Template Sort In C++
- by wdow88
Hey all, I'm trying to write a sort function but am having trouble figuring out how to initialize a value, and making this function work as a generic template. The sort works by:
Find a pair =(ii,jj)= with a minimum value = ii+jj = such at A[ii]A[jj]
If such a pair exists, then
swap A[ii] and A[jj] else
break;
The…