1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
balu736 [363]
3 years ago
10

Consider the following recursive method: public int someFun(int n) { if (n <= 0) return 2; else return someFun(n-1) * someFun

(n-1); } (a) When the program calls someFun(5), how many times will someFun(3) be called? (b) What does this method calculate when the input parameter n is a non-negative integer?
Computers and Technology
1 answer:
Stella [2.4K]3 years ago
3 0

Answer:

(a) someFunc(3) will be called 4 times.

(b) For non negative number n someFunc method calculates 2^2^n.

Explanation:

When you call someFunc(5) it will call someFunc(4) two time.

So now we have two someFunc(4) now each someFunc(4) will call someFunc(3) two times.Hence the call to someFun(3) is 4 times.

someFunc(n) calculates someFunc(n-1) two times and calculates it's product.

someFunc(n) = someFunc(n-1)^2..........(1)

someFunc(n-1)=someFunc(n-2)^2..........(2)

substituting the value form eq2 to eq 1.

someFunc(n)=someFunc(n-2)^2^2

       .

       .

       .

       .

= someFunc(n-n)^2^n.

=2^2^n

2 raised to the power 2 raised to the power n.

You might be interested in
What is the equivalent of film speed in digital cameras?
elena55 [62]
The equivalent of film speed in a digital camera is going to be sensitivity. This will make the correct answer B. 
3 0
3 years ago
Read 2 more answers
(Giving away points!)
Komok [63]

Answer:

Used to lol not anymore tho :p

8 0
2 years ago
What is the most significant issue that needs to be addressed when ensuring the proper functioning of a computer?
ycow [4]

Answer:

The most significant issue addressed while ensuring the proper functionality of computer is the working of Operating System.

Explanation:

There are many issues faced while making the computer properly functional. Such as, Memory size, processor speed, software installation etc. while operating system not working properly can cause a significant problem. If operating system is not working properly, the user is unable to use the computer.

So, to make sure the functioning of computer, the significant issue that should be needed to address is Operating System Installation.

7 0
2 years ago
What is the other name of iterative staatement ​
Mademuasel [1]

Answer:

An loop statement

Explanation:

An iteration statement, loop, repeatedly executes a statement, know as a loop body,until the controlling expression is false

8 0
2 years ago
When listing columns in the select list, what should you use to separate the columns?
Gala2k [10]
The answer is commas.  <span>When listing columns in the select list, commas should be used to separate the columns.</span>
6 0
3 years ago
Other questions:
  • Paulene is using this table in Word,and she started with the cursor in the box that read “Flavor”. she then hits Alt+End,The the
    7·1 answer
  • In ssl/tls, a specific set of protocols that a particular cryptographic system will use to provide protection is called a ______
    5·1 answer
  • The standing toe touch is most likely to result in
    15·1 answer
  • Dillard’s wants to learn about its consumers' attitudes toward online purchases. There are numerous studies that are available a
    9·1 answer
  • Briley has all the hardware she needs to construct a fully functional personal computer. She connects the various components and
    7·1 answer
  • Does anyone know the answers?
    8·1 answer
  • . A possible data for source that could be used when completing a mail merge could be a(n)… : *
    13·2 answers
  • An algorithm that could execute for an unknown amount of time because it depends on random numbers to exit a function may:______
    13·1 answer
  • Why is manual coding the best way to learn HTML?
    11·1 answer
  • There are types of templates​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!