1,代码题:Remove nodes from a LinkedList that have the given value.
这题比较简单,就是给一个LinkedList和一个int值,去掉List里面所有包含这个值的节点。方法就不多说了,相信大家都是闭着眼睛秒杀的。这道题可以用C, C++或者Java做。默认的是Java。这个题是可以在线跑一下的,提交之前可以确保所有test case都通过。
12,给出一段C#代码,问f(x)的时间复杂度 (which best describes the growth of f(X) as a function of X)
代码大概是这样的:
int f(int x)
{
if(x<1) return 1;
else return f(x-1) +g(x/2);
}