上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页
摘要: // Fibonaqii.cpp : Defines the entry point for the console application./*data:2013/10/05auth:ljzfunc:斐波那契数列的非递归实现*/#include "stdafx.h"#include "iostream"using namespace std;int Fibonaqii(int n){ int a=1,b=1,c; if (n == 1 || n ==2) { return 1; } else { for (int i =3;i>n; cout&l 阅读全文
posted @ 2013-10-05 21:03 呱呱老师 阅读(138) 评论(0) 推荐(0)
摘要: // Fibonaqi.cpp : Defines the entry point for the console application./*data:2013/10/05auth:ljzfunc:斐波那契Fn的递归函数*/#include "stdafx.h"#include "iostream"using namespace std;int Fibonaqi(int n){ if (n == 1 || n == 2) { return 1; } else { return ( Fibonaqi(n-1)+Fibonaqi(n-2) ); }}int 阅读全文
posted @ 2013-10-05 20:39 呱呱老师 阅读(196) 评论(0) 推荐(0)
摘要: // Factorial.cpp : Defines the entry point for the console application./*data:2013/10/05auth:ljzfunc:n!的递归实现*/#include "stdafx.h"#include "iostream"using namespace std;int Factorial(int n){ if (n==1) { return 1; } else { return n*Factorial(n-1); }}int main(int argc, char* argv[]) 阅读全文
posted @ 2013-10-05 20:35 呱呱老师 阅读(128) 评论(0) 推荐(0)
摘要: // Factorial.cpp : Defines the entry point for the console application./*data:2013/10/05auth:ljzfunc:n!的非递归实现*/#include "stdafx.h"#include "iostream"using namespace std;int Factorial(int n){ int sum =1; for (int i=1;i>a; cout<<Factorial(a)<<endl; return 0;} 阅读全文
posted @ 2013-10-05 20:31 呱呱老师 阅读(128) 评论(0) 推荐(0)
摘要: // rise.cpp : Defines the entry point for the console application./*data:2012/10/05auth:ljzfunc:rise判断数组是不是按升序排列的。*/#include "stdafx.h"#include "iostream"using namespace std;bool rise(int b[]){ for (int i =0;i=b[i+1]) { return false; } } return true;}int main(int argc, char* argv 阅读全文
posted @ 2013-10-05 20:27 呱呱老师 阅读(147) 评论(0) 推荐(0)
摘要: // Input.cpp :/*data:2013/10/5auth:liaojiangzhengfunc: INPUT(&a)用户输入一个非负的数,并且负责验证输入的是不是正数,如果不是告诉用户输入非法,重输(共3次机会)。输入成功,将输入的数作为引用参数返回。函数成功返回true,否则返回false。*/#include "stdafx.h"#include "iostream"using namespace std;bool INPUT( float &a){ int i = 0; float b; b=a; while (b> 阅读全文
posted @ 2013-10-05 20:05 呱呱老师 阅读(182) 评论(0) 推荐(0)
摘要: // singal.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "iostream"using namespace std;int main(int argc, char* argv[]){// printf("Hello World!\n"); char a[100]; cout>a; cout<<"输入的串是:"<<a<<endl; for 阅读全文
posted @ 2013-10-03 08:59 呱呱老师 阅读(907) 评论(0) 推荐(0)
摘要: 6月来到硅谷,开始投简历,准备面试的知识,一直到9月才找到。期间简历大概投了有200个,收到面试电话大概在40~50之间,收到onsite面试大概在10个左右。不知道国内找工作怎么样。在本科的时候也投过校招的简历。大多数得到的都是被安排在一个教室里面,做一张试卷,做的好,然后才有安排下一轮。因为当时注重出国,所以有了下一轮,也没去。记得当时有腾讯,百度,迅雷等公司,但是都没去。挺是遗憾。在硅谷这边,一开始基本是网上投简历。而且投的职位还只能是entrylevel或者junior的。因为别人一般都是招有工作经验的,所以像我这种只读书的毫无竞争力。每天不断的刷新,有新的职位就投一封。大概在2~3周 阅读全文
posted @ 2013-10-01 00:00 呱呱老师 阅读(233) 评论(0) 推荐(0)
摘要: 基本的计算步骤 时间复杂度的定义 一般情况下,算法中基本操作重复执行的次数是问题规模n的某个函数,用T(n)表示,若有某个辅助函数f(n),使得当n趋近于无穷大时,T(n)/f(n)的极限值为不等于零的常数,则称f(n)是T(n)的同数量级函数。记作T(n)=O(f(n)),称O(f(n))为算法的渐进时间复杂度(O是数量级的符号 ),简称时间复杂度。根据定义,可以归纳出基本的计算步骤 1. 计算出基本操作的执行次数T(n) 基本操作即算法中的每条语句(以;号作为分割),语句的执行次数也叫做语句的频度。在做算法分析时,一般默认为考虑最坏的情况。2. 计算出T(n)的数量级 求T(n)的数... 阅读全文
posted @ 2013-09-30 23:39 呱呱老师 阅读(373) 评论(0) 推荐(0)
摘要: 该算法是每次分两半(最坏情况)。假设总长度N,N * (1/2)^x = 1;所以2^x = N,所以x=logn (底为2)。 阅读全文
posted @ 2013-09-30 23:11 呱呱老师 阅读(242) 评论(0) 推荐(0)
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页