随笔分类 -  每日一算法

摘要:LRC Example Code This function is an example how to calculate a LRC BYTE using the C language.BYTE LRC (BYTE *nData, WORD wLength){BYTE nLRC = 0 ; // 阅读全文
posted @ 2017-06-19 10:32 未命名blogs 阅读(550) 评论(0) 推荐(0)
摘要:#include "stdafx.h" void insertSort(int* array,int len ) { // [0,i-1] [i,n-1] // 直接插入排序: [0,i-1]是已排序的序列 [i,n-1]是没有排序的序列 // 算法的核心思想:在已排序序列的[0,i-1]找到合适的位置插入当前要排序的元素i。 // 分两种情形: ... 阅读全文
posted @ 2017-04-25 05:07 未命名blogs 阅读(123) 评论(0) 推荐(0)
摘要:// SelectSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" int sort(int* p,int len ) { int index,temp,i,j; if( p == NULL || len <= 1 ) { r... 阅读全文
posted @ 2017-04-23 10:38 未命名blogs 阅读(110) 评论(0) 推荐(0)
摘要:int bubbleSort1(int* array,int len ) { int i ,j,temp; i = j = temp = 0; for( i = 0; i i;j-- ) { if( array[j-1] > array[j] ) { temp = ... 阅读全文
posted @ 2017-04-21 18:07 未命名blogs 阅读(539) 评论(0) 推荐(0)