📄 shellsort.cpp
字号:
// See Programming Problem 8void shellsort(DataType theArray[], int n){ for (int h = n/2; h > 0; h = h/2) { for (int unsorted = h; unsorted < n; ++unsorted) { DataType nextItem = theArray[unsorted]; int loc = unsorted; for (; (loc >= h) && (theArray[loc-h] > nextItem); loc = loc - h) theArray[loc] = theArray[loc-h]; theArray[loc] = nextItem; } // end for } // end for} // end shellsort
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -