摘要:
2014-05-11 23:57题目链接原题:9 identical balls. one ball is heavy. find the heavy ball with only 2 measurements ........ dead easy.题目:9个看起来一样的球,其中有一个偏重。给定一个... 阅读全文
摘要:
2014-05-11 23:52题目链接原题:design an alarm clock for a deaf person.题目:为聋人设计闹钟?解法:聋人听不见,那么闪光、震动都可行。睡着的人也看不见光,所以震动应该是更靠谱的。个人觉得做成手表戴在手上的时候,才能保证震动有用。这样,睡觉的时候就... 阅读全文
摘要:
2014-05-11 03:56题目链接原题:Given an integer array. Perform circular right shift by n. Give the best solution.题目:给数组进行循环移位,给出最优解。解法:首先要考虑n的范围,对于负数和超过数组长度的数... 阅读全文
摘要:
2014-05-11 03:37题目链接原题:You have three jars filled with candies. One jar is filled with banana candies, one jar is filled with lemon candies and one ja... 阅读全文
摘要:
2014-05-11 02:56题目链接原题:Write a function called FooBar that takes input integer n and prints all the numbers from 1 upto n in a new line. If the number... 阅读全文
摘要:
2014-05-10 23:45题目链接原题:Arrange the numbers in an array in alternating order. For example if the array is [a1, a2, a3, a4.. ]arrange the array such tha... 阅读全文
摘要:
2014-05-10 23:26题目链接原题:what is the best,worst and average case complexity for fibonacci no.s ..explain?题目:计算斐波那契数的最好、最坏、平均复杂度是多少?解法:计算斐波那契数倒是有好多方法,不过平... 阅读全文