几道英语面试题

nosuchtracter 2008-04-24 01:21:45
一、Binary Search and it's use
二、Suppose you have 10000 Electronic circuits in hand.
Now more than half of those circuits are good and rest are bad. There is only one way to find out if a circuit is good or bad. You have to compare the circuit with another circuit. Suppose you want to find out if circuit A is good or bad. You compare it with another circuit B. Now if B is a good circuit it will tell you the truth about A.
But if B is a bad circuit it's answer about a is not reliable. Write a function to find out one good circuit.
第一道有点难
大家帮忙看下

...全文
160 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
stning 2008-04-24
  • 打赏
  • 举报
回复
帮顶
nosuchtracter 2008-04-24
  • 打赏
  • 举报
回复
有1000个电路圈,一半以上是好的,其余的都是坏的。
有一种方法可以查找A是个好的还是坏的
用B去比较A,如果B是好的,则A是好的,如果B是坏的,则说明A是不可靠的
写个函数,查找一个好的线圈
意思应该是这么翻译的吧?
boyle0630 2008-04-24
  • 打赏
  • 举报
回复
题目都看不太懂,帮顶
nosuchtracter 2008-04-24
  • 打赏
  • 举报
回复
怎么把页面给撑大了
不会自动换行啊
nosuchtracter 2008-04-24
  • 打赏
  • 举报
回复
第二道题目有点困难
shoumangli 2008-04-24
  • 打赏
  • 举报
回复
1、例:(C语言)

方程式为:f(x) = 0,示例中f(x) = 1+x-x^3

使用示例:

input a b e: 1 2 1e-5

solution: 1.32472

源码如下:

#include <stdio.h>

#include <stdlib.h>

#include <math.h>

#include <assert.h>

double f(double x)

{

return 1+x-x*x*x;

}

int main()

{

double a = 0, b = 0, e = 1e-5;

printf("input a b e: ");

scanf("%lf%lf%lf", &a, &b, &e);

e = fabs(e);

if (fabs(f(a)) <= e)

{

printf("solution: %lg\n", a);

}

else if (fabs(f(b)) <= e)

{

printf("solution: %lg\n", b);

}

else if (f(a)*f(b) > 0)

{

printf("f(%lg)*f(%lg) > 0 ! need <= 0 !\n", a, b);

}

else

{

while (fabs(b-a) > e)

{

double c = (a+b)/2.0;

if (f(a)* f ( c ) < 0)

b = c;

else

a = c;

}

printf("solution: %lg\n", (a+b)/2.0);
}
return 0;
}
奔跑的蜗牛007 2008-04-24
  • 打赏
  • 举报
回复
支持一下
chinayeren 2008-04-24
  • 打赏
  • 举报
回复
.
nosuchtracter 2008-04-24
  • 打赏
  • 举报
回复
第一道是二分法,英语不好,还以为是考数据结构呢,呵呵
没人顶准备结贴了
nosuchtracter 2008-04-24
  • 打赏
  • 举报
回复
没人顶吗?

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧