recategorized by
1,340 views
0 votes
0 votes

Consider the following recursive Java function $f$ that takes two long arguments and returns a float value:

public static float f (long m, long n) {
float result = (float)m / (float)n;
if (m < 0 || n<0) return 0.0f;
else result -=f(m*2, n*3);
return result;
}

Which of the following real values best approximates the value of $f(1,3)$?

  1. $0.2$
  2. $0.4$
  3. $0.6$
  4. $0.8$
recategorized by

Please log in or register to answer this question.

Answer:

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
3 answers
2
go_editor asked Nov 20, 2020
1,717 views
In HTML, $<\text{map}>$ tag is used fordefining a path between two nodes in an imagedefining clickable region in an imagehighlighting an area in an imagedefining the site...
0 votes
0 votes
1 answer
3
go_editor asked Nov 20, 2020
971 views
The data node and name node in HADOOP areWorker Node and Master Node respectivelyMaster Node and Worker Node respectivelyBoth Worker NodesBoth Master Nodes
0 votes
0 votes
1 answer
4
go_editor asked Nov 20, 2020
1,272 views
Which of the following $UML$ diagrams has a static view?Collaboration diagramUse-Case diagramState chart diagramActivity diagram