摘要: Say Given a 2d array where all the numbers in the array are in increasing order from left to right and top to bottom.What is the best way to search and determine if a target number is in the array?sample:int a[][] = { {1, 3, 5, 7, 9}, {2, 6, 11, 13, 15}, {4, 12, 17, 19, 21}, {8, 14, 18, 23, 25}/... 阅读全文
posted @ 2012-01-06 12:02 百分百好牛 阅读(481) 评论(0) 推荐(0) 编辑
摘要: Sum the linked lists 1->2->3 4->5result is 1->6->81->5->95->3result 2->1->2A: 把链表的值加起来,注意,根据sample,是从链表的最后一位开始相加,而且,要考虑进位的问题pseudo code如下 (通过编译,但没有测试用例)View Code LinkNode* SumLinkLists(LinkNode *p1, LinkNode *p2){ if (NULL == p1 && NULL == p2) return NULL; if (N 阅读全文
posted @ 2012-01-06 11:12 百分百好牛 阅读(161) 评论(0) 推荐(0) 编辑
摘要: There is integer array like {1,2,4,5,6,1,2,4,3,5,7,2,1}. I want to find the possible combination of pair which sum is 4. input : {1,2,4,5,6,1,2,4,3,5,7,2,1}output : {1,1,2}, {2,2}, {3,1}, {1,2,1}...etc which make the sum as 4A:这是一个subset sum problem问题,该类型问题的解法见 wiki,比较复杂http://en.wikipedia.org/wiki/ 阅读全文
posted @ 2012-01-06 10:11 百分百好牛 阅读(295) 评论(0) 推荐(0) 编辑
摘要: Fill in the blanks:_ _ _ H I K L M N T_ _ _ G J O P Q R SA:第一行所有的字母都是直线组成的第二行所有的字母都包括有曲线所以第一行前面补 A E F第二行前面补 B C D 阅读全文
posted @ 2012-01-06 09:44 百分百好牛 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 导读:Brad Feld的一篇文章The Rise of Developeronomics中提到了“10倍效率的开发者(10x developer)”的概念(伟大的开发者的效率往往比一般的开发者高很多,而不只是一点点),Adam Loving在读了之后受到启发,并向多位大牛(Ben Sharpe、Collin Watson和Jonathan Locke)询问如何成为“10倍效率的开发者”,最后得到... 阅读全文
posted @ 2011-12-30 14:05 百分百好牛 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Print the numbers of form (2^i)*(5^j) in increasing order, e.g. 1, 2, 4, 5, 8, 10, 16, 20, …Q:题目很简单了,就是打印整数序列,该序列的生成规则为(2^i)*(5^j)View Code 1 void Compute_Increasing_Order() 2 { 3 int arr[20] = {0}; 4 arr[0]= 1; printf("%d, ", arr[0]); 5 int count_2 = 0; 6 int count_5 = 0; 7 fo... 阅读全文
posted @ 2011-12-29 11:52 百分百好牛 阅读(211) 评论(0) 推荐(0) 编辑
摘要: Given an in-order traversal only for a binary tree (not necessarily a BST), give a pseudo code to generate all possible binary trees for this traversal sequence.A: 数学归纳法Firstly of all, with ‘n’ number of nodes, there are (2n)!/n!*(n+1)!If like the normal definition, in-order is left child->self-& 阅读全文
posted @ 2011-12-28 10:23 百分百好牛 阅读(254) 评论(0) 推荐(0) 编辑
摘要: Given a set of n symbols a size k and a combination of length k of non repeating characters from the symbol set. Write only an ITERATIVE algorithm to print the next unique combination.Ex: Symbols =[1,2,3,4,5] size = 3; given combination = 123, result = 124 given combination = 254, result = 312Q:提供一个 阅读全文
posted @ 2011-12-23 17:11 百分百好牛 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 不知道自己的未来在何方?这着实是一件令人苦恼的事情。在第一职场网进行职业生涯规划的实际咨询过程中,有很多朋友不知道如何确立自己的目标,纷纷前来求助寻找目标的方法。大家不妨按照以下的14个步骤,反复实践,相信会对你的目标寻找有所帮助。 这是一个重要的练习,它能让你勇敢地去梦想,去了解自己。当我们不知我们要什么时,我们如何去要?所以,这个职业生涯规划的练习,是让我们去了解自己所要的,以及要如何去要。建议找一个时间,静静地坐下来,拿起你的纸与笔,一步一步来做。也许,你没有一次做完所有的步骤,没有关系,第二天再找一个时间,继续你未完的内心历程。建议,在一周内完成这个练习。然后经常拿起来看看,你会慢慢发 阅读全文
posted @ 2011-12-20 09:47 百分百好牛 阅读(435) 评论(0) 推荐(2) 编辑
摘要: Given an expression remove the unnecessary brackets in it without creating an ambiguity in its execution.input outputex1: (a+(b)+c) => a+b+cex2: (a*b)+c => a*b+c 阅读全文
posted @ 2011-12-19 22:28 百分百好牛 阅读(259) 评论(0) 推荐(0) 编辑