z*******e 发帖数: 122 | 1 1. You are in a brainstorm meeting, propose some suggestions to Bing so that
it can beat Google's search engine
2. Describe the difference between Java and C to a 4 year old boy
3. describe the algorithm of tower of hanoi
4. How two test a laser pen
5. Outside the area of web search, describe two scenarios that you will use
techniques from artifical intelligence
6. You have an array of 1 million integers, there is at most one 5 in the
array. write code to find the index of 5, or return -1 if the |
k***e 发帖数: 556 | 2 第六题你是说将在最后一个entry后面添加5 从而减少一个if的判断?
很难啊 Knuth的书上写了这个技巧 但是提供效率也只是50%还是多少
that
use
The
【在 z*******e 的大作中提到】 : 1. You are in a brainstorm meeting, propose some suggestions to Bing so that : it can beat Google's search engine : 2. Describe the difference between Java and C to a 4 year old boy : 3. describe the algorithm of tower of hanoi : 4. How two test a laser pen : 5. Outside the area of web search, describe two scenarios that you will use : techniques from artifical intelligence : 6. You have an array of 1 million integers, there is at most one 5 in the : array. write code to find the index of 5, or return -1 if the
|
z*******e 发帖数: 122 | 3 对,就是这个技巧,如果不用,用一般的for循环,每个iteration要做3个比较操作,
比较是否到了数组尾部,index++,比较是不是等于5, 用了sentinel之后,就只需要
做2个操作,就是这一点优化。。。。 |
k***e 发帖数: 556 | 4 感觉有点吹毛求疵啊
因为这个必须写成汇编才能看出来 如果按照一般的分析方法 复杂度就是线性
不过你还挺牛的 应该是科班出身 哈哈
【在 z*******e 的大作中提到】 : 对,就是这个技巧,如果不用,用一般的for循环,每个iteration要做3个比较操作, : 比较是否到了数组尾部,index++,比较是不是等于5, 用了sentinel之后,就只需要 : 做2个操作,就是这一点优化。。。。
|
x******3 发帖数: 245 | 5 狂zan
【在 z*******e 的大作中提到】 : 对,就是这个技巧,如果不用,用一般的for循环,每个iteration要做3个比较操作, : 比较是否到了数组尾部,index++,比较是不是等于5, 用了sentinel之后,就只需要 : 做2个操作,就是这一点优化。。。。
|