Vidéo pédagogique
Lieu de réalisation
Langue :
François Rechenmann (Intervention)
Conditions d'utilisation
Ces ressources de cours sont, sauf mention contraire, diffusées sous Licence Creative Commons. L’utilisateur doit mentionner le nom de l’auteur, il peut exploiter l’œuvre sauf dans un contexte commercial et il ne peut apporter de modifications à l’œuvre originale.
DOI : 10.60527/pnsj-q734
Citer cette ressource :
François Rechenmann. Inria. (2015, 5 février). 4.8. A recursive algorithm , in 4. Sequences comparison. [Vidéo]. Canal-U. (Consultée le 13 juillet 2024)

4.8. A recursive algorithm

Réalisation : 5 février 2015 - Mise en ligne : 9 mai 2017
  • document 1 document 2 document 3
  • niveau 1 niveau 2 niveau 3

We have seen how we can computethe optimal cost, the ending node of our grid if we know the optimal cost of the three adjacent nodes. This is this computation scheme we can see here using the notation of the pseudo code and not the mathematical notation we used in the previous sessions. So again we can compute the cost of this node if we know the cost of that node, that node and that node and we have to add respectively the insertion cost, the substitution cost orthe insertion cost. The substitution cost here depends on the letter at this position in the sequence and this letter atthe position of the first sequence. The interesting point here is tounderstand that this scheme can also be applied for that node. If you make the hypothesis, you know the costs at that node, at that node and that node, then using the same schema you can compute the cost at that node. The same cost which will be used to compute the cost at the ending node. So this is the scheme at the basis of our recursive function. What is a recursive function? A recursive function is something which may appear a bit magic the first time because it's a function which is called within its own execution. You call the function, it begins the execution and at one or several points the function is called again, that's why it's called recursive.


Dans la même collection

Avec les mêmes intervenants et intervenantes