-2
$\begingroup$

Let's say I have a range from 11 to 99 I need to find:

abs(a/b)-k = min, a nd b - integer, k-an irrational number

I can just look at all pairs of numbers in quadratic time

for(i=11;i<99;++i)
 for(j=i;j<99;++j)
  abs()...

and find the minimum, but is it possible to do this in linear time, for example?

$\endgroup$
1
  • $\begingroup$ Your question does not appear to be a research-level question in theoretical computer science. For more information about the scope, please see help center, cstheory.stackexchange.com/help/on-topic. Your question might be suitable for Computer Science which has a broader scope, cs.stackexchange.com. $\endgroup$
    – Neal Young
    yesterday

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.