We konden deze vermelding niet vinden. Er worden benaderende resultaten weergegeven. Controleer je spelling of stel voor deze term aan het woordenboek toe te voegen.
So that factorial would not be a tail recursive function.
Ainsi, factoriel n'est pas une fonction de tail recursion.
So let's rectify that, and design a tail recursive function instead.
Nous allons donc rectifier cela et concevoir une fonction recursive terminale a la place.
So, how would we implement that in a tail recursive fashion?
Comment pouvons nous implיmenter une fonction de tail recursion?
After having gone through the exercise, you might ask yourself, should every function be tail recursive?
Après ces exercices, vous pouvez vous demander, est-ce que chaque fonction est une tail recursion?
Could say a tail recursive function is the functional form of a loop, and it executes just as efficiently as a loop.
On peut dire qu'une fonction de tail recursion est la forme fonctionnelle d'une boucle et elle s'exécute aussi efficacement qu'une boucle.
So now the task is to design a tail recursive version of the same function.
Maintenant, le but est de crיer une version de tail recursion de cette fonction.
So, in that case definitely it was not worth making factorial a tail recursive function.
Dans ce cas, cela ne fallait dיfinitivement pas le coup de faire de factoriel une fonction de tail recursion.
And by applying that trick, it means that a tail recursive function can execute in constant stuck space, so it's really just another formulation of an iterative process.
Et en appliquant cet astuce, cela signifie qu'une fonction de tail recursion peut exיcuter dans un espace de capacitי constante, c'est donc simplement une autre formulation d'un processus intיratif.
You've seen factorial, and we've seen that, that version of the function was not tail recursive.
Vous avez vu factoriel, vous avez vu que cette version de la fonction n'יtait pas une tail recursion.
So if your, the input data is such that these deep recursive chains could happen, then yes it's a good idea to reformulate your function to be tail recursive, to run in constant stack frame, so as to avoid stack overflow exceptions.
Donc si votre donnיe en input est telle que ces chaines rיcursives profondes pourraient arriver alors oui, c'est une bonne idיe de reformuler votre fonction en une tail recursion pour l'exיcuter dans un stack frame constant, pour יviter les exceptions d'overflow de stacks.
And that translate its, to a rewriting sequence that was essentially constant size, and that will, in the actual execution on a computer, translate into a tail recursive call that can execute in constant space.
Et cela se traduit par une sיquence rייcrite qui יtait essentiellement de taille constante et qui va, dans l'execution effective de l'ordinateur, se traduire par un appel de tail recursion qui peut s'exיcuter dans un espace constant.
So that call here is not a tail recursive call, and it becomes evident in the reduction sequence, where you see that actually there's a buildup of intermediate results that we all have to keep until we can compute the final value.
Cet appel ici n'est donc pas un appel de tail recursion, et cela devient יvident dans la sיquence de rיduction ou on voit qu'il y a en fait une accumulation de rיsultats intermיdiaires que nous devons garder avant de pouvoir calculer la valeur finale.
Potentieel gevoelige of ongepaste informatie
Er worden alleen voorbeelden gegeven om u te helpen het woord of de woordcombinatie waarop u hebt gezocht, te vertalen. Deze worden niet door ons geselecteerd of gevalideerd en kunnen ongepaste taal bevatten. Wij vragen u melding te maken van voorbeelden die dienen te worden aangepast of verwijderd. Vertalingen met grof of informeel taalgebruik worden meestal rood of oranje gemarkeerd.