c09p498.txt
来自「Data Abstraction & Problem Solving with 」· 文本 代码 · 共 13 行
TXT
13 行
void 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 + =
减小字号Ctrl + -
显示快捷键?