
数据结构
文章平均质量分 66
仲轲
爱好广泛,追求极致!
展开
-
二分法查找的两种方法
转载自http://blog.youkuaiyun.com/h971379154/article/details/48845355 #include int BinSearch_Recursion(int Array[],int low,int high,int key); //递归方法 int BinSearch_Recursion(int Array[],int len,int key) {转载 2015-10-01 11:36:23 · 2906 阅读 · 0 评论 -
链表基本操作
转载自http://blog.youkuaiyun.com/h971379154/article/details/48860495 #include #include #include typedef struct node{ int data;//数据域 struct node *pNext;//指针域 }Node,*pNode; // Nodestruct node p转载 2015-10-18 18:32:44 · 402 阅读 · 0 评论 -
常见字符串操作函数
转载自http://blog.youkuaiyun.com/h971379154/article/details/48846755 //常见字符串操作函数内部实现 #include size_t strlen(const char *s)//char型指针间距可表示长度 { const char *sc; for (sc = s; *sc != '\0'; ++sc); ret转载 2015-10-18 19:04:31 · 428 阅读 · 0 评论 -
字符串回文和数字回文
转载自http://blog.youkuaiyun.com/h971379154/article/details/48161751 1.字符串回文判断 所谓字符串回文就是逆序后与原来字符串相同,如“abccba”就是回文字符串。 使用递归求解,递归结束情景: 字符串长度可能会奇数或偶数: (1)如果字符串长度是奇数,字符串会剩下转载 2015-10-19 10:36:39 · 537 阅读 · 0 评论 -
三种字符串逆序的方法
转载自http://blog.youkuaiyun.com/h971379154/article/details/47998423 //字符串逆序 #include #include //新创建等长度的数组,将原数组从末字符一次放入新数组 char *Reverse_String(char *src) { if(NULL==src) return src; char *p =转载 2015-10-19 11:24:21 · 992 阅读 · 0 评论 -
斐波那契的递归函数
#include #include /*int main()//此为常规方法 { int i; int a[32]; a[0]=0; a[1]=1; printf("%d ",a[0]); printf("%d ",a[1]); for (i=2;i<40;i++) { a[i]=a[i-1]+a[i-2]; printf("%d ",a[i]); } return原创 2015-10-06 16:31:31 · 637 阅读 · 0 评论 -
查找(顺序,有序)总结
一、代码示例 #include int Binary_Search_Recursion(int *a,int low,int high,int key); int F(int i); /*顺序查找,a为数组,len为要查找的数组个数,key为要查找的关键字*/ //代码1 int Sequential_Search(int *a,int len,int key) { int i; fo原创 2015-10-08 15:37:15 · 953 阅读 · 1 评论