Editar distancia algoritmo recursivo - Skiena

Estoy leyendo The Algorithm Design Manual de Steven Skiena, y estoy en el capítulo de programación dinámica. Tiene algún código de ejemplo para la distancia de edición y utiliza algunas funciones que no se explican en el libro ni en Internet. Así que me pregunto

a) ¿Cómo funciona este algoritmo?

b) ¿Qué hacen las funciones indel y match?

#define MATCH     0       /* enumerated type symbol for match */
#define INSERT    1       /* enumerated type symbol for insert */
#define DELETE    2       /* enumerated type symbol for delete */

int string_compare(char *s, char *t, int i, int j)
{
        int k;                  /* counter */
        int opt[3];             /* cost of the three options */
        int lowest_cost;        /* lowest cost */

        if (i == 0) return(j * indel(' '));
        if (j == 0) return(i * indel(' '));

        opt[MATCH] = string_compare(s,t,i-1,j-1) + match(s[i],t[j]);
        opt[INSERT] = string_compare(s,t,i,j-1) + indel(t[j]);
        opt[DELETE] = string_compare(s,t,i-1,j) + indel(s[i]);

        lowest_cost = opt[MATCH];
        for (k=INSERT; k<=DELETE; k++)
                if (opt[k] < lowest_cost) lowest_cost = opt[k];

        return( lowest_cost );
}

Respuestas a la pregunta(5)

Su respuesta a la pregunta