

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


void shellSort(int array[], int size) { int gap, j, k,temp; for(gap = size/2; gap > 0; gap = gap / 2) { //initially gap = n/2, //decreasing by gap / for(j = gap; j<size; j++) { for(k = j-gap; k >= 0; k -= gap) { if(array[k+gap] >= array[k]) break; else 0.]=[-P0;'] -*9/8 temp = array[k+gap]; array[k+gap] = array[k]; array[k] = temp; } } cout <<"\n Using" << gap << " "; gap; printArray(); } }
void bucketSort(int array[],int size) {
vector