ocaml: phase 5.1 activity_select.ml baseline (greedy non-overlap = 4)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s

Activity selection by earliest end time. Manual bubble sort over
(start, end) tuple array, then sweep accepting whenever the next
start >= last_end.

  intervals: (1,4) (3,5) (0,6) (5,7) (3,8) (5,9) (6,10) (8,11)
             (8,12) (2,13) (12,14)

  selection: (1,4) -> (5,7) -> (8,11) -> (12,14)  = 4 activities

Tests double-loop bubble sort on tuple array with let-pattern
destructure for swap-key extraction, in-place swap of tuple cells.

192 baseline programs total.
This commit is contained in:
2026-05-11 04:04:42 +00:00
parent 3f00e62577
commit 90ba37ecc8
3 changed files with 41 additions and 0 deletions

View File

@@ -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-11 Phase 5.1 — activity_select.ml baseline (greedy
earliest-end-time activity selection on 11 intervals → max
non-overlapping 4). Sort intervals by end time (bubble sort to
avoid relying on List.sort with tuple comparator), then sweep
and accept whenever start ≥ last_end. Optimal selection:
(1,4) → (5,7) → (8,11) → (12,14) = 4 activities. Tests double-
loop bubble sort on tuple array with let-pattern destructure
for swap key extraction, in-place swap of tuple cells via temp.
192 baseline programs total.
- 2026-05-11 Phase 5.1 — count_paths_dag.ml baseline (count
source-to-sink paths in the same 6-node DAG as topo_sort.ml,
paths 0→5 = 3). Topological sort via Kahn's (BFS), then relax