⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qsort6.c

📁 自己做的常用库和实现的数据结构。public domain.
💻 C
字号:
void   quicksort(int   v[],   int   low,   int   high)    {            int   lowIndex[MAXSIZE],   highIndex[MAXSIZE];                int   n;                int   last;            int   currentLow,   currentHigh;            int   i;                       n   =   1;            lowIndex[n]   =   low;            highIndex[n]   =   high;            while   (n   >   0)   {                    currentLow   =   lowIndex[n];                    currentHigh   =   highIndex[n];                    --n;                                       if   (currentLow   >=   currentHigh)                            continue;                                                                                   last   =   currentLow;                    for   (i   =   currentLow   +   1;   i   <=   currentHigh;   ++i)   {                            if   (v[i]   <   v[currentLow])   {                                    ++last;                                    swap(v,   last,   i);                            }                    }                    swap(v,   currentLow,   last);                    ++n;                    lowIndex[n]   =   last   +   1;                    highIndex[n]   =   currentHigh;                    ++n;                    lowIndex[n]   =   currentLow;                    highIndex[n]   =   last   -   1;            }    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -