2018年2月18日
摘要: 3-1最长单调递增子序列 设计一个o(n2)时间的算法,找出由n个数 阅读全文
posted @ 2018-02-18 16:07 HE不言 阅读(83) 评论(0) 推荐(0) 编辑
  2018年2月16日
摘要: 递归与分治策略 2-1Hanoi塔问题的非递归算法 证明:Hanoi塔问题的递归算法与非递归算法实际上是一回事。 分析: 递归问题算法: void hanoi(int n,int A,int B,int C) { if (n>0) { hanoi(n-1,A,C,B); move(n,A,B); h 阅读全文
posted @ 2018-02-16 21:36 HE不言 阅读(917) 评论(0) 推荐(0) 编辑
摘要: 恢复内容开始 3n+1问题: while (n>1) if (odd(n)) n=3*n+1; else n=n/2; //在最坏的情况下,该算法的计算时间下界显然为log(n) 算法计算时间上界至今未知。著名的3n+1猜想,也称collatz猜想。 证明:如果一个算法在平均情况下的计算时间复杂性为 阅读全文
posted @ 2018-02-16 19:22 HE不言 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 1.APP运行时发生OOM的原因你知道哪几种?如何避免? 一是资源对象没关闭造成的内存泄漏,try catch finally 中将资源回收到finally 语句可以有效避免 OOM,资源性对象比如: 1-1 Cursor 1-2调用resigterReceiver()后未调用unregisterR 阅读全文
posted @ 2018-02-16 11:42 HE不言 阅读(125) 评论(0) 推荐(0) 编辑
  2018年2月11日
摘要: 面试例题1:which of the following statements describe the results of executing the code snippet below in c++? int i=1; void main() { int i=i; } The i withi 阅读全文
posted @ 2018-02-11 11:56 HE不言 阅读(104) 评论(0) 推荐(0) 编辑
  2018年2月7日
摘要: http://blog.csdn.net/miaolinjie/article/details/8462440 1、以下程序的运行结果是() int main(void) { printf("%s , %5.3s\n","computer","computer"); return 0; } A、co 阅读全文
posted @ 2018-02-07 18:55 HE不言 阅读(656) 评论(0) 推荐(0) 编辑
摘要: c++面试题 1.是不是一个父类写了一个virtual函数,如果子类覆盖他的函数不加virtual, 也能实现多态? virtual 修饰符会被隐形继承的。 private也被集成,只事派生类没有访问权限而已 virtual 可加可不加 子类的空间里有父类的所有变量(static除外) 同一个函数只 阅读全文
posted @ 2018-02-07 15:10 HE不言 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 1.找错 void test1() { char string[10]; char *str1="0123456789"; strcpy(string,str1); } 试题一字符串str1需要11个字节才能存放下(包括末尾的‘/0'),而string 只有10个字节的空间,strcpy会导致数组越 阅读全文
posted @ 2018-02-07 12:15 HE不言 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 每日英文长难句20180206 How well the predictions will be validated by later performance depends upon the amount,reliability,and appropriateness of the informa 阅读全文
posted @ 2018-02-07 00:17 HE不言 阅读(96) 评论(0) 推荐(0) 编辑
  2018年2月6日
摘要: 48 .100w个数中找出最大的100个数 方案1:用一个含100个元素的最小堆完成。复杂度为o(100w*lg100) 方案2:采用快速排序的思想,每次分割之后只考虑轴大的一部分,知道 方案3:采用局部淘汰法 47.给出一行c语言表达式,判断给定的整数是否是一个2的幂? (b &(b-1))==0 阅读全文
posted @ 2018-02-06 23:10 HE不言 阅读(141) 评论(0) 推荐(0) 编辑