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

資源簡介

收集整理了C語言中常用的經(jīng)典排序方法(冒泡排序、選擇排序、插入排序、希爾排序、快速排序、堆排序 )及動圖演示 。

資源截圖

代碼片段和文件信息

#include?“iostm8s103F3.h“
#include?“l(fā)ed.h“
#include?“sort.h“


int?num[10]?=?{6?23?43?56?12?67?41?64?78?87};

void?SysClkInit(?void?)
{
????CLK_SWR?=?0xe1;???????//HSI為主時鐘源??16MHz?CPU時鐘頻率
????CLK_CKDIVR?=?0x00;????//CPU時鐘0分頻,系統(tǒng)時鐘0分頻
}


void?delay_ms(?unsigned?int?ms?)
{
????unsigned?char?i;
????while(?ms?!=?0?)
????{
????????for(?i?=?0;?i?????????for(?i?=?0;?i?????????ms--;
????}
}
void?delay_us(?unsigned?int?Tus?)
{
????__asm(?“nop“?);
}


//生成隨機數(shù)組
void?randNum(?int*?num?)
{
????int?i?=?0;
????while(?i?????{
????????num[i++]?=?rand()?%?99;
????}
}


void?main(?void?)
{
????int?i;
????SysClkInit();
????__asm(?“sim“?);???????????????????????//禁止中斷
????LED_GPIO_Init();
????__asm(?“rim“?);???????????????????????//開啟中斷
????LED?=?0;
????delay_ms(?5000?);
????while(?1?)
????{
????????LED?=?0;?????????????????????????//LED=0?和?LED=!LED??執(zhí)行效率差距很大
????????delay_ms(?2000?);
????????LED?=?1;
????????delay_ms(?2000?);
????????
????????//bubbleSort_1(num10);
????????//bubbleSort_2(num10);
????????insertSort(num10);
????????/*
????????bubbleSort(?num?10?);????????????//冒泡排序
????????randNum(?num?);
????????
????????selectSort(?num?10?);????????????//選擇排序
????????randNum(?num?);
????????
????????insertSort(?num?10?);???????????//直接插入排序
????????randNum(?num?);
????????
????????insertSortBinary(?num?10?);??????//二分插入排序
????????randNum(?num?);
????????
????????shellSort(?num?10?);?????????????//希爾(插入)排序
????????randNum(?num?);
????????
????????quickSort(?num?10?0?9?);???????//快速排序
????????randNum(?num?);
???????????
????????heapSort(?num?10?);??????????????//堆排序
????????randNum(?num?);
????
????????selectSortBinary(?num10?);???????//二元選擇排序
?????????randNum(?num?);
*/
????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-06-26?17:30??STM8S_sort\
?????文件????????2397??2018-05-15?14:52??STM8S_sort\BuildLog.log
?????目錄???????????0??2019-06-26?09:21??STM8S_sort\Debug\
?????目錄???????????0??2019-06-26?16:42??STM8S_sort\Debug\Exe\
?????文件????????1691??2019-06-26?16:42??STM8S_sort\Debug\Exe\LED.hex
?????文件???????33128??2019-06-26?16:42??STM8S_sort\Debug\Exe\LED.out
?????目錄???????????0??2019-06-26?16:42??STM8S_sort\Debug\List\
?????文件???????12564??2019-06-26?16:42??STM8S_sort\Debug\List\LED.map
?????目錄???????????0??2019-06-26?17:00??STM8S_sort\Debug\Obj\
?????文件????????6098??2019-06-26?09:30??STM8S_sort\Debug\Obj\led.o
?????文件??????313645??2019-06-26?17:00??STM8S_sort\Debug\Obj\LED.pbd
?????文件??????313645??2019-06-26?17:00??STM8S_sort\Debug\Obj\LED.pbd.browse
?????文件?????????169??2019-06-26?17:00??STM8S_sort\Debug\Obj\LED.pbd.linf
?????文件??????224869??2019-06-26?09:23??STM8S_sort\Debug\Obj\led.pbi
?????文件???????11501??2019-06-26?09:23??STM8S_sort\Debug\Obj\led.pbi.xcl
?????文件???????13731??2019-06-26?16:42??STM8S_sort\Debug\Obj\main.o
?????文件??????228940??2019-06-26?16:42??STM8S_sort\Debug\Obj\main.pbi
?????文件???????11493??2019-06-26?16:42??STM8S_sort\Debug\Obj\main.pbi.xcl
?????文件???????39152??2019-06-26?16:42??STM8S_sort\Debug\Obj\sort.o
?????文件??????311063??2019-06-26?17:00??STM8S_sort\Debug\Obj\sort.pbi
?????文件???????11502??2019-06-26?17:00??STM8S_sort\Debug\Obj\sort.pbi.xcl
?????目錄???????????0??2019-06-26?17:00??STM8S_sort\HardWare\
?????文件?????????194??2019-05-30?11:41??STM8S_sort\HardWare\led.c
?????文件?????????170??2019-05-30?11:41??STM8S_sort\HardWare\led.h
?????文件???????11315??2019-06-26?17:00??STM8S_sort\HardWare\sort.c
?????文件???????10770??2019-06-26?15:56??STM8S_sort\HardWare\sort.c.orig
?????文件?????????703??2019-06-26?15:59??STM8S_sort\HardWare\sort.h
?????文件????????7522??2019-06-26?17:30??STM8S_sort\LED.dep
?????文件???????16039??2018-05-15?16:50??STM8S_sort\LED.ewd
?????文件???????58664??2019-06-26?09:23??STM8S_sort\LED.ewp
?????文件??????160674??2019-06-26?09:23??STM8S_sort\LED.ewt
............此處省略24個文件信息

評論

共有 條評論