![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构和算法
Beyond_cn
这个作者很懒,什么都没留下…
展开
-
C或C++ 求两个数组相同元素个数
问:两个数组f[] g[] 长度不定 元素从大到小排列好了 每个数组中元素各不相同 请问如何编程能求两个数组相同元素个数 例如f[4]={1,3,4,7} g[5]={2,3,5,7,8} 有2个相同返回2 并求时间复杂度 最好时间复杂度小点 就是运算次数越少越好答:#include int Match2Array(const int * pArray1 , int iSize1 , co转载 2013-08-15 12:55:52 · 8892 阅读 · 0 评论 -
简单的实现atoi函数源代码
#include int my_atoi(const char* p){ assert(p != NULL); bool neg_flag = false;// 符号标记 int res = 0;// 结果 if(p[0] == '+' || p[0] == '-') neg_flag = (*p++ == '-'); while(is原创 2013-09-22 08:43:51 · 1422 阅读 · 0 评论