工作准备
文章平均质量分 72
Ididcan
这个作者很懒,什么都没留下…
展开
-
面试问题
创新工厂李开复:1)描述一下你曾经做过的最重要项目?2)当今互联网中让你印象最深刻的项目是什么?做到最好的产品是什么?为什么?3)你的老板最让你不满意的地方是什么?最让你满意的地方是什么?你觉得你的老板应该具有什么样的品质?4)我问你的老板你最大的缺点是什么,他会如何形容?原创 2009-10-24 14:18:00 · 633 阅读 · 0 评论 -
经典面试题——求任意两个叶节点中最近的父节点
以下程序未经测试,仅供参考!#include #include using namespace std;struct LCATreeNode{ LCATreeNode* m_pLeft; LCATreeNode* m_pRight; int m_value;}bool nodePath(LCATreeNode* root, int原创 2012-09-19 21:44:21 · 2960 阅读 · 0 评论 -
经典面试题——二维矩阵子矩阵和问题
两种方法:有空再详细说明#include #include using namespace std;int sumOfArray_1(int** array, int m, int n){ int **a = new int*[m+1]; int **sum = new int*[m+1]; for(int i = 0 ; i <= m; ++i){ s原创 2012-09-19 16:30:04 · 1162 阅读 · 0 评论 -
智力题集合
1)a) 4 , 4 , 6 , 12 , 30 , ( ). answer: 4/4 = 1; 6/4 = 1.5; 12/6 = 2; 30/12 = 2.5;b)-1 , 6 , 25 , 62, ( ). answer: a^3-2....c)1,4,2,7,3,8,(),9. answer: 1+ 9 = 4 + 6 = 2+ 8 = 7+3;原创 2009-10-28 09:27:00 · 768 阅读 · 0 评论 -
编程之美——3.10 分层遍历二叉树
学过数据结构我们很容易知道如何进行宽度优先遍历树,那么这道题就是对宽度优先遍历树的算法进行改进。 1 / \ 2 3 / \ \ 4 5 6 / \ 7 8运用BFS只能输出1,2,3,4,5,6,7,8这个序列,并不知道分层信息,因此如何分层打印呢?原创 2012-09-16 21:56:59 · 1171 阅读 · 0 评论 -
编程之美——2.19 区间重合判断
将区间按照x来排序(递增),然后依次判断目标区间的起始位置是否在这些区间上,例如判断区间 [a,b] 是否在区间 [c,d] , [e,f]之中,我们可以分析c d,e f的关系,按照之前所述的方法排好序之后[c,d] , [e,f]要么相交,要么相离。如果相交,那么e=d。由此可以看到只要判断a是否在 [c, d]之间就好,如果在就将a增加到d,然后循环判断,知道所有区间都被遍历一遍,如果所有区原创 2012-09-16 21:16:25 · 3059 阅读 · 1 评论 -
经典面试题——求字符串中最长的数字串
在字符串中找出连续最常的字符串,并把这个串的长度返回。并把这个最长数字串赋给一个函数参数outputstr所指向的内存。例如"abcd12345ed123sf3343461346345" 的首地址赋给inputstr后函数返回9,outputstr所指向的值为“3343461346345”;#include using namespace std;int maxContinueN原创 2012-09-13 14:59:53 · 1710 阅读 · 0 评论 -
经典面试题——首次出现的单字符
在一个字符串中找到第一个出现,并且只出现一次的字符,例如abaccdeff,输出b这是谷歌在2006年的一道笔试题。#include #include #include using namespace std;unsigned char findFirstChar(char *str, int n){ int range = sizeof(char)<<8; i原创 2012-09-13 11:07:40 · 947 阅读 · 1 评论 -
经典面试题——子数列和
输入两个整数n和m,从数列1,2,3...,n中随意取几个数使其和等于m,要求将其中所有可能都列出来。#include using namespace std;void sumOfSubArray(int m, int n){ if(m<0 || n<1) return; int sum = 1; for(int i = 1, j = 1; j < n;){原创 2012-09-13 14:51:19 · 1039 阅读 · 0 评论 -
微软笔试面试题集锦
(一)编程实现两个正整数的除法编程实现两个正整数的除法,当然不能用除法操作符 想法是这样的:被除数不断减去含除数的最大2^n倍数。例如,200/5,那么以此为200-5*2^5=40 result = 2^5 =32 ,40-5*2^3=0 result=32+2^3 = 40。所以结果为40.int div(const int x, const int y) {int原创 2011-10-13 15:57:10 · 679 阅读 · 0 评论 -
经典面试题21——包含min函数的栈
定义栈的数据结构,请在该类型中实现一个能够得到栈的最小元素的min函数,在该栈的调用中,调用min、push、以及pop、的时间复杂度都是O(n)。代码如下:#include #include #include #include using namespace std;templateclass MinStack{private: stack s;原创 2012-08-31 12:43:19 · 867 阅读 · 0 评论 -
经典面试题(七)
利用两个栈来实现队列的操作。代码如下所示#include #include using namespace std;templateclass QueueFromStack{private: stack s1; stack s2;public: // use reference instead of variable pass原创 2012-08-29 15:08:14 · 788 阅读 · 0 评论 -
C笔记——printf 的原理
C中的可变参数研究一. 何谓可变参数int printf( const char* format, ...);这是使用过C语言的人所再熟悉不过的printf函数原型,它的参数中就有固定参数format和可变参数(用”…”表示). 而我们又可以用各种方式来调用printf,如:printf( "%d ",value);printf( "%s ",str);printf( "the number is转载 2011-06-12 18:47:00 · 949 阅读 · 0 评论 -
double类型数据 位移操作
由于位操作的对象是整型变量,所以你必须利用某种转换让编译器把浮点变量暂时当成整型变量。不过,直接强制转换是不行的: float f = 12.34; int i = (int)f; // i最后等于12而不是你想要的结果! 所以,转换必须是“间接”的: float f = 12.34; int *p = (转载 2011-06-12 20:24:00 · 5000 阅读 · 0 评论 -
2011-6-12 碰到的几个小问题
(一)printf 问题:double i = 1;int j = 2;printf("i = %d, j = %d/n", i , j);那么得到的结果是:i = 0, j = 1072693248具体原理参照:http://blog.csdn.net/Ididcan/archive/2011/06/12/6539800.aspx测试代码如下:原创 2011-06-12 20:21:00 · 1029 阅读 · 0 评论 -
常用工具总结
常用工具总结<br /> ildasm:反编译.net程序;<br /> ilasm:编译il代码;<br /> Reflector:查看.net程序源码、程序集间的依赖关系;<br /> Xenocode Fox 2007:由.net程序生成.net工程;<br /> PEBrowseDbg:动态调试.net程序;<br /> WinDbg,OlleyDbg:调试分析程序;<br /> MASMPlus:查看编写编译汇编代转载 2010-10-13 09:37:00 · 1415 阅读 · 0 评论 -
经典面试题——n皇后问题
一个典型的回溯法!作为练习。有几个关键地方需要注意,就是判断皇后的位置是否合法。pos[i] 表示第i个皇后应该排在的位置。因此对于第k个皇后而言,需要满足 pos[i]!=pos[k] 同时 abs(i-k)!=abs(pos[i]-pos[k])#include using namespace std;bool canPlace(int pos[], int k)原创 2012-09-21 16:55:30 · 1880 阅读 · 0 评论