wk3&&4(recursion)

 0    7 schede    up804653
Scarica mp3 Stampa Gioca Testa il tuo livello
 
Domanda English Risposta English
Define recursion?
inizia ad imparare
Recursion is a technique whereby a problem is expressed in a similar form to the original problem but smaller in scope.
What are the two requirements of a recursive algorithm?
inizia ad imparare
Solution is easy to specify for certain conditions – stopping case. Rules for proceeding to a new state which is either a stopping case or eventually leads to a stopping case – recursive steps
Explain Stopping case/base case
inizia ad imparare
The known answer the smallest value that one that can be fed back in to the function
Explain the recursive step
inizia ad imparare
All other cases that are not the base case that will cal back the function/method
When should you not use recursion?
inizia ad imparare
if no to any of the following: the algorithm/data structure naturally suited to recursion? Is the recursive solution shorter and more understandable? Does the recursive solution run in acceptable time limits and/or space limits?
What is tail end recursion?
inizia ad imparare
there is one recursive call in an algorithm and this call is the very last thing the done.
What is back tracking?
inizia ad imparare
Backtracking is a systematic trial and error approach to finding the solution to a problem.

Vedi schede correlate:

wk5&&6 (LinkedLists)

Devi essere accedere per pubblicare un commento.