Redian新闻
>
G的电面题,是什么意思啊?
avatar
G的电面题,是什么意思啊?# JobHunting - 待字闺中
R*r
1
Programming: interval halving. Given a continuous function 'f(x)'
and an interval on the x-axis from 'start' to 'end'. It is know
that 'f(x)=0' for exactly one value of 'x' between 'start' and
'end', and that ‘f(x)’ crosses the x-axis at this point. Write a
program that repeatedly cuts in half the interval until the
interval containing 'f(x)=0' is equal or less than 'epsilon' wide.
原题就是这样直接贴上来,一个老印,听不懂他说什么又看不明白题目,数学的东西也好
久没看了,看来是死定了。大家能说说这题目是什么吗?谢谢。
avatar
q*x
2
binary search to solve f(x) = 0.

也好

【在 R***r 的大作中提到】
: Programming: interval halving. Given a continuous function 'f(x)'
: and an interval on the x-axis from 'start' to 'end'. It is know
: that 'f(x)=0' for exactly one value of 'x' between 'start' and
: 'end', and that ‘f(x)’ crosses the x-axis at this point. Write a
: program that repeatedly cuts in half the interval until the
: interval containing 'f(x)=0' is equal or less than 'epsilon' wide.
: 原题就是这样直接贴上来,一个老印,听不懂他说什么又看不明白题目,数学的东西也好
: 久没看了,看来是死定了。大家能说说这题目是什么吗?谢谢。

avatar
b*8
3
这是送分题啊,CS科班的都会。
avatar
s*c
4
我也没看懂。。。。google以后才知道题目的意思。就是求方程f(x)=0的根。已知根x
的范围是(start,end),让你用二分法求x。
avatar
y*g
5
需要牛顿法吗?还是直接二分就ok了?
avatar
i*9
6
呵呵,也有送分老印啊
avatar
b*8
7
不能指望该F函数一定有解析形式可以求导,或者F函数干脆就是个黑盒子,你告诉X他
给出Y。二分法无论如何都行,其他改进方法就有限制了。

【在 y*******g 的大作中提到】
: 需要牛顿法吗?还是直接二分就ok了?
avatar
q*x
8
there's convergence issue.

【在 y*******g 的大作中提到】
: 需要牛顿法吗?还是直接二分就ok了?
avatar
R*r
9
现在知道是binary search to solve f(x) = 0当然就容易了,但电面时搞不明白他问
什么,说话口音也不清楚,问他sample case也不肯说,搞了半天还没搞明白,浪费不
少时间,最后他叫我跳过这题了。
avatar
q*x
10
the problem description is clear to me...

【在 R***r 的大作中提到】
: 现在知道是binary search to solve f(x) = 0当然就容易了,但电面时搞不明白他问
: 什么,说话口音也不清楚,问他sample case也不肯说,搞了半天还没搞明白,浪费不
: 少时间,最后他叫我跳过这题了。

avatar
R*r
11
没办法,那就是我太菜了。

【在 q****x 的大作中提到】
: the problem description is clear to me...
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。