" 

 == The calculation of 'cost' don't need branching == 

 The calculation of 'cost' is not branching. The indicator function is only boolean evaluation expression. If ... else statement is redundant and confusing. Please see http://c2.com/cgi/wiki?ReturnBooleanEvaluations in WikiWikiWeb. So the recursive C implementation source code is the following -    

 // len_s and len_t are the number of characters in string s and t respectively 
 int LevenshteinDistance(string s, int len_s, string t, int len_t) { // 'string' is not in C. It's std::string in C++. 
   // base case: empty strings 
   if (len_s == 0) return len_t; 
   if (len_t == 0) return len_s; 

   // check mismatch of last characters of the strings 
   bool mismatch = (s[len_s-1] != t[len_t-1]); // The bool type requires C++ or modern C(C99 or above) (#include ) 
   int cost = (int)mismatch; 

   // return minimum of delete char from s, delete char from t, and delete char from both 
   return minimum(LevenshteinDistance(s, len_s - 1, t, len_t    ) + 1, 
                  LevenshteinDistance(s, len_s    , t, len_t - 1) + 1, 
                  LevenshteinDistance(s, len_s - 1, t, len_t - 1) + cost); 
 } 
 "