How is recursion handled internally, Computer Engineering

Assignment Help:

How is recursion handled internally?

Internally, every recursive call to a function requires storing the intermediate values of the parameters and local variables in a run time stack. The common algorithm for any recursive procedure having the following steps:

 1. Save the parameters, local variables and return address.

 2. If the base criterion has been arrived, then perform the final computation and go to step 3, or else perform the partial computation and go to step 1 with condensed parameter values (initiate a recursive call).

 3. Restore the most newly saved parameters, local variables and return address. Go to this return address.

 


Related Discussions:- How is recursion handled internally

Operation research, how to implement a modified distribution method using c...

how to implement a modified distribution method using c/c++

State in brief about virtual memory, What is Virtual memory The term v...

What is Virtual memory The term virtual memory signifies something that appears to be present though actually it is not. Virtual memory technique enables users to use more mem

How to create a rollover image, Q. How to Create a Rollover Image? A ro...

Q. How to Create a Rollover Image? A rollover image is an image whose display changes when pointer passes ('rolls') over it. You will use Dreamweaver's Insert Rollover Image co

What is metropolitan area network, Q. What is Metropolitan Area Network? ...

Q. What is Metropolitan Area Network? Metropolitan Area Network (MAN):  It is privately or public owned communication system that naturally covers a complete city. Speed is abo

What is a mutable member, One that can be modified by the class even when t...

One that can be modified by the class even when the object of the class or the member function doing the modification is const.

Recent parallel programming models, A model for parallel programming is an ...

A model for parallel programming is an abstraction and is machine architecture independent. A model can be executed on several hardware and memory architectures. There are various

Expert systems, An expert systems is software that contains a knowledge ...

An expert systems is software that contains a knowledge base of facts and relationships and has the ability to make inferences based on that knowledge base. An experts sys

What are the elements of an instruction, Q. What are the elements of an ins...

Q. What are the elements of an instruction? As the function of instruction is to communicate to CPU what to do it needs a minimum set of communication such as:  What op

Catch output from child tasks, Q. Catch output from child tasks? ...

Q. Catch output from child tasks? int pvm_catchout( FILE *ff ) Catch output from child tasks. ff is file descriptor on which we write collected output. The defau

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd