由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - A C++ question
相关主题
想到一个曾经被JPM问过的算法题one statistic interview question
讨论几个 ihtw 大牛的题目[合集] 关于Goldman Sachs的一个职位问题
C++里面如何最方便的表示这个数组的数组?[合集] 中期底部
How to overloading a matrix classquant developer position at an IB
[合集] another interview question[合集] [brainteaser]X1, X2,...,Xn are independent random variables
怎么估计五次根号下31的value[合集] one question
计算Bond Yield的数值方法[合集] algorithm problem.
Implied Vol Calculation[合集] 那道corr矩阵的题有人看见吗?
相关话题的讨论汇总
话题: c++话题: variables话题: use话题: integer话题: question
进入Quant版参与讨论
1 (共1页)
o****e
发帖数: 80
1
Given a positive integer, return the integer part of its square root.
Requirements: cannot use any math
functions; can only use integer variables, no double variables even for
intermediate variables; as efficient as
possible.
l******l
发帖数: 497
2
binary search between (0,n/2)
c**********e
发帖数: 2007
3

no use of +-*/?

【在 o****e 的大作中提到】
: Given a positive integer, return the integer part of its square root.
: Requirements: cannot use any math
: functions; can only use integer variables, no double variables even for
: intermediate variables; as efficient as
: possible.

f******y
发帖数: 2971
4
Come on, this is NOT a C++ question.
J*******g
发帖数: 267
5
Newton-Raphson method?

【在 o****e 的大作中提到】
: Given a positive integer, return the integer part of its square root.
: Requirements: cannot use any math
: functions; can only use integer variables, no double variables even for
: intermediate variables; as efficient as
: possible.

j******n
发帖数: 271
6
1. Use shift to find out the position of highest bit, M.
2. Do binary search in the range:
[ 2^(M/2) , 2^((M+1)/2) )
1 (共1页)
进入Quant版参与讨论
相关主题
[合集] 那道corr矩阵的题有人看见吗?[合集] another interview question
[合集] An interview question怎么估计五次根号下31的value
[合集] 请问一道题计算Bond Yield的数值方法
question about maximu summationImplied Vol Calculation
想到一个曾经被JPM问过的算法题one statistic interview question
讨论几个 ihtw 大牛的题目[合集] 关于Goldman Sachs的一个职位问题
C++里面如何最方便的表示这个数组的数组?[合集] 中期底部
How to overloading a matrix classquant developer position at an IB
相关话题的讨论汇总
话题: c++话题: variables话题: use话题: integer话题: question