SEARCH
You are in browse mode. You must login to use MEMORY

   Log in to start

level: Recursion

Questions and Answers List

level questions: Recursion

QuestionAnswer
In the context of programming state what recursion isA subroutine which calls itself
What are the characteristics of a recursive subroutineMust contain a stopping cndition (base case) For any input values other than teh stopping condition the routine must call itself Stopping condition must be reachable after a finite number if loops
Why is recursion used Give an exmpleSometimes recursion is the only/ best way in which to complete a problem Tree traversal algorithm
What are the benifits of recursion(Usually) fewer lines
What are the downsides of recursion and whyNot very efficient on memory Every time a recursion is called, processor ha to remreber where it was in the program Remever the values of the varaibles beasue they are local to that copy of the fucnion
What datastructures used for recursionStack