91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

南昌航空大學(xué)的十次試驗(yàn)代碼,每次的實(shí)驗(yàn)代碼都實(shí)現(xiàn)了主要需求!!!

資源截圖

代碼片段和文件信息

#include?“stdio.h“
#include?“malloc.h“
#include?“stdlib.h“

#define?ERROR?0
#define?OK?1
#define?OVERFLOW?-1
#define?MAXSIZE?20

typedef?int?ElemType;
typedef?struct
{
ElemType?*elem;
int?length;
}SqList;

int?InitList(SqList?*L?int?n);
int?CreateList(SqList?*L?int?n);
int?Partition(SqList?*L?int?low?int?high);
int?QSort(SqList?*L?int?low?int?high);
int?QuickSort(SqList?*L);
int?printList(SqList?L);

void?main()
{
SqList?L;
int?n;

printf(“Enter?the?data?numbers:“);
scanf(“%d“?&n);
InitList(&L?n);
CreateList(&L?n);
QuickSort(&L);
printf(“The?sort?data?is:“);
printList(L);
}

int?InitList(SqList?*L?int?n)
{
L->elem=(ElemType?*)malloc((n+1)*sizeof(ElemType));
if(!L->elem)
return?OVERFLOW;
L->length=n;
return?OK;
}

int?CreateList(SqList?*L?int?n)
{
int?i;

printf(“Enter?the?%d?datas:“?n);
for(i=1;?i<=n;?i++)
{
scanf(“%d“?&L->elem[i]);
}
return?OK;
}

int?Partition(SqList?*L?int?low?int?high)
{
int?pivotkey;

L->elem[0]=L->elem[low];
pivotkey=L->elem[low];

while(low {
while(lowelem[high]>=pivotkey)
high--;
L->elem[low]=L->elem[high];
while(lowelem[low]<=pivotkey)
low++;
L->elem[high]=L->elem[low];
}
L->elem[low]=L->elem[0];

return?low;
}

int?QSort(SqList?*L?int?low?int?high)
{
int?pivotloc;

if(low {
pivotloc=Partition(L?low?high);
QSort(L?low?pivotloc-1);
QSort(L?pivotloc+1?high);
}
return?OK;
}

int?QuickSort(SqList?*L)
{
QSort(L?1?L->length);
return?OK;
}

int?printList(SqList?L)
{
int?i;

for(i=1;?i<=L.length;?i++)
printf(“%3d“?L.elem[i]);
printf(“\n“);
return?OK;
}

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件???????1729??2003-02-02?05:45??10201118_黃輝波\lab101.c

?????文件???????1601??2003-02-02?06:34??10201118_黃輝波\lab102.c

?????文件???????1826??2012-03-19?16:59??10201118_黃輝波\lab11.c

?????文件???????3850??2012-03-19?18:06??10201118_黃輝波\lab12.c

?????文件???????2279??2012-01-11?10:49??10201118_黃輝波\LAB21.C

?????文件???????3223??2012-01-11?11:32??10201118_黃輝波\LAB22.C

?????文件???????4287??2012-04-17?12:52??10201118_黃輝波\lab31.c

?????文件???????1427??2012-04-17?21:11??10201118_黃輝波\lab32.c

?????文件???????1273??2012-01-25?11:40??10201118_黃輝波\lab41.c

?????文件???????5267??2012-04-25?13:35??10201118_黃輝波\lab42.c

?????文件???????2940??2012-02-08?10:27??10201118_黃輝波\lab51.c

?????文件???????3034??2012-02-15?11:30??10201118_黃輝波\lab61.c

?????文件???????3675??2012-02-22?10:58??10201118_黃輝波\LAB71.c

?????文件???????2521??2012-02-29?11:40??10201118_黃輝波\lab81.c

?????文件???????2985??2012-05-29?21:54??10201118_黃輝波\lab82.c

?????文件???????1354??2012-06-05?18:52??10201118_黃輝波\lab91.c

?????文件???????2192??2012-03-07?10:40??10201118_黃輝波\lab92.c

?????目錄??????????0??2012-06-20?21:36??10201118_黃輝波

-----------?---------??----------?-----??----

????????????????45463????????????????????18


評(píng)論

共有 條評(píng)論

相關(guān)資源