- 博客(4)
- 资源 (2)
- 收藏
- 关注
原创 字符串移位
void *pszStringRotate(char *pszString, intnCharsRotate) 比如ABCDEFG,移3位变DEFGABC,要求空间复杂度O(1),时间复杂度O(n)。 过程如下: ABCDEFG 第一步:局部翻转 ABC DEFG == = 》 CBA GFED 第二步:整体翻转 CBA GFED
2015-10-09 09:45:16 512
原创 递归法和循环法判断数组是否递增
#include using namespace std; #include bool Judgment(int a[], int num) { static int i = 0; bool flag = true; for(i=0; i<num-1; i++) { if (a[i]>=a[i+1]) //假如发现哪两个不是递增,立刻跳出; { flag = f
2015-10-06 15:31:01 693
转载 strcpy与memcpy的区别
原文: http://blog.chinaunix.net/uid-23922099-id-3555928.html #include using namespace std; char * strcpy(char * strDest, const char * strSrc) // 实现strSrc到strDest的复制 { if ((strDest == NULL) || (strSrc
2015-10-06 14:03:24 495
原创 反转字符串递归与非递归方式
#include using namespace std; char *reverse(char *str)//非递归方式 { if(str!=NULL) { int length = strlen(str); for(int i=0;i<length/2;++i) { char temp=str[i];
2015-10-06 13:23:48 439
Quartus II 14.1+ ModelSim SE-64 10.4 Verilog后仿真
2018-04-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人