ocaml: phase 5.1 min_meeting_rooms.ml baseline (8 meetings, min 4 rooms)
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
Sweep-line algorithm via separately-sorted starts / ends arrays:
while i < n do
if starts[i] < ends[j] then begin busy++; rooms = max; i++ end
else begin busy--; j++ end
done
intervals: (0,30) (5,10) (15,20) (10,25) (5,12)
(20,35) (0,5) (8,18)
At time 8, meetings (0,30), (5,10), (5,12), (8,18) are all active
simultaneously -> answer = 4.
Tests local helper bound via let (`let bubble a = ...`) for
in-place sort, dual-pointer sweep on parallel ordered event streams.
193 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-11 Phase 5.1 — min_meeting_rooms.ml baseline (sweep-line
|
||||
for min concurrent meetings on 8 intervals = 4). Separate starts
|
||||
and ends arrays sorted independently, then a two-pointer sweep:
|
||||
on start<end push a new room (busy+1), else release one (busy-1).
|
||||
Intervals: (0,30) (5,10) (15,20) (10,25) (5,12) (20,35) (0,5)
|
||||
(8,18). At time 8: meetings (0,30), (5,10), (5,12), (8,18) all
|
||||
active → 4 simultaneous = answer. Tests local recursive helper
|
||||
`let bubble a = …` for in-place sort, dual-pointer sweep on
|
||||
ordered events. 193 baseline programs total.
|
||||
- 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
|
||||
|
||||
Reference in New Issue
Block a user