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
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:
@@ -407,6 +407,15 @@ _Newest first._
|
||||
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
|
||||
'a tree`) with insert + in-order traversal. Tests parametric ADT,
|
||||
recursive match, List.append, List.fold_left.
|
||||
- 2026-05-10 Phase 5.1 — lev_iter.ml baseline (iterative
|
||||
Levenshtein DP, sum of 5 distances = 16). Rolling-array DP
|
||||
(O(min(m,n)) space). Distances: kitten→sitting=3, saturday→
|
||||
sunday=3, abc→abc=0, ""→abcde=5, intention→execution=5;
|
||||
3+3+0+5+5=16. Complementary to existing levenshtein.ml which
|
||||
uses the recursive (exponential) definition; this one is the
|
||||
practical iterative form used for real ED computations. Tests
|
||||
the new `<- if ... then ... else ...` rhs path twice in the
|
||||
same body. 153 baseline programs total.
|
||||
- 2026-05-10 Phase 5.1 — binary_heap.ml baseline (array-backed
|
||||
binary min-heap, push 9 random values then pop in sorted order
|
||||
→ digits concat to 123456789). Standard heap mechanics: parent
|
||||
|
||||
Reference in New Issue
Block a user