- 博客(4)
- 资源 (1)
- 收藏
- 关注
原创 冒泡排序
/* *冒泡排序 * 比较相邻的两个数,如果前者大于后者,就交换位置; 每次排到最后面的大数,下次不再比较 */ #include void bubble_sort(int *arr,int len) { register int temp=0; int i=0; int j=0; int flag=1; for(i=0;i<len-1 && flag==1;i++) //一
2017-06-30 22:06:11 259
原创 从字符串中获取最长子串的长度
/* *获取字符串最长子串,为了避免回溯,采用一个数组指针,每个字符 *对应的值作为数组索引并指向该字符开始的子串;在遍历该字符串的 *过程中,数组指针指向该字符最后一次出现的位置; *temp指向 字符*end 上一次在字符串中出现的位置,然后让addr[*end] *指向字符*end当前位置;若temp指针指向的位置在s指针的右边,则根据 *temp指针指向的位置调整s指针的位置。 * */
2017-06-13 10:10:27 960
原创 二叉树 相关操作
#include #include #include #define TREE_TYPE inttypedef struct tree_node {TREE_TYPE value;struct tree_node *left;struct tree_node *right;}TreeNode;/**指向根节点的指针,static 防止其他文件修改*///static TreeNode *tree;
2017-06-10 09:43:53 269
原创 KMP字符串查找算法
#include #include void get_next(char *t,int *next) { int i=0,j=-1; next[0]=-1; while(t[i]!='\0') { if(j==-1 || t[i]==t[j]) { i++,j++; printf("%d %d\n",i,j); if(t[i]!=t[j]) next
2017-06-07 14:47:14 398
基于ARM11视频采集的WiFi小车
2016-06-19
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人