PPT Slide
if (l-f==1) {// b[f..l] has two elements
if (b[f] > b[l]) {
// Swap b[f] and b[l]
int t= b[f]; b[f]= b[l]; b[l]= t; }}
else if (l-fɭ) { //b[f..l] has > 2 elements
// Add bounds of b[f..j-1] and b[j+1..k] to c
int j= partition(b,f,l);
c[i]= new Bounds(f,j-1);
i= i+1;
c[i]= new Bounds(j+1,l);
i= i+1;}}}
Previous slide
Next slide
Back to first slide
View graphic version