+ All Categories
Home > Documents > 8 - Ordenamiento Shell

8 - Ordenamiento Shell

Date post: 08-Mar-2016
Category:
Upload: oscar-am
View: 219 times
Download: 0 times
Share this document with a friend
Description:
” void ordenShell(int A[],int n) { int i, j, inc, temp; for(inc = 1 ; inc 0) { for (i=inc; i < n; i++) { j = i; temp = A[i]; while ((j >= inc) && (A[j-inc] > temp)) { A[j] = A[j - inc]; j=j-inc; } A[j] = temp; } inc/= 2; } }
Popular Tags:
7
Transcript
Page 1: 8 - Ordenamiento Shell
Page 2: 8 - Ordenamiento Shell
Page 3: 8 - Ordenamiento Shell

Page 4: 8 - Ordenamiento Shell
Page 5: 8 - Ordenamiento Shell
Page 6: 8 - Ordenamiento Shell

void ordenShell(int A[],int n) { int i, j, inc, temp; for(inc = 1 ; inc<n;inc=inc*3+1); while (inc > 0) { for (i=inc; i < n; i++) { j = i; temp = A[i];

Page 7: 8 - Ordenamiento Shell

while ((j >= inc) && (A[j-inc] > temp)) { A[j] = A[j - inc]; j = j - inc; } A[j] = temp; } inc/= 2; } }


Recommended