ocaml: phase 5.1 lev_iter.ml baseline (sum of 5 edit distances = 16)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s

Iterative Levenshtein DP with rolling 1D arrays for O(min(m,n))
space. Distances:

  kitten    -> sitting    : 3
  saturday  -> sunday     : 3
  abc       -> abc        : 0
  ""        -> abcde      : 5
  intention -> execution  : 5
  ----------------------------
  total                   : 16

Complementary to the existing levenshtein.ml which uses the
exponential recursive form (only sums tiny strings); this one is
the practical iterative variant used for real ED.

Tests the recently-fixed <- with bare `if` rhs:

  curr.(j) <- (if m1 < c then m1 else c) + 1

153 baseline programs total.
This commit is contained in:
2026-05-10 06:53:38 +00:00
parent 0ef26b20f3
commit b4571f0f9f
3 changed files with 40 additions and 0 deletions

View File

@@ -90,6 +90,7 @@
"lcs.ml": 4,
"majority_vote.ml": 4,
"manacher.ml": 7,
"lev_iter.ml": 16,
"levenshtein.ml": 11,
"memo_fib.ml": 75025,
"mortgage.ml": 1073,