ocaml: phase 5.1 task_scheduler.ml baseline ("AAABBC" cooldown 2 -> 7)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s

Task-scheduler closed-form min total intervals:

  m = max letter frequency
  k = number of letters tied at frequency m
  answer = max((m - 1) * (n + 1) + k, total_tasks)

For "AAABBC" with cooldown n = 2:
  freq A = 3, freq B = 2, freq C = 1 -> m = 3, k = 1
  formula = (3 - 1) * (2 + 1) + 1 = 7
  total tasks = 6
  answer = 7

Witness schedule: A, B, C, A, B, idle, A.

Tests String.iter with side-effecting count update via
Char.code arithmetic, fixed-size 26-bucket histogram.

195 baseline programs total.
This commit is contained in:
2026-05-11 04:34:40 +00:00
parent 33be068c01
commit 67ece98ba1
3 changed files with 28 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 — task_scheduler.ml baseline (task cooldown
formula, "AAABBC" with n=2 → 7 intervals). Counts each letter,
finds max frequency `m` and the number of letters that hit that
max `k`. Formula: `(m-1)·(n+1) + k`, taking the larger of that
and the total task count when interleaving fills the schedule.
Witness: A,B,C,A,B,idle,A satisfies cooldown 2 between A→A and
B→B. Tests String.iter with side-effecting closure (count
histogram update via Char.code arithmetic). 195 baseline
programs total.
- 2026-05-11 Phase 5.1 — min_subarr_target.ml baseline (sliding-
window min subarray with sum ≥ target on [2;3;1;2;4;3] target=7
= 2). Two-pointer: expand right, then shrink left while sum