ocaml: phase 5.1 egg_drop.ml baseline (2 eggs, 36 floors -> 8 trials)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s
Classic egg-drop puzzle DP:
dp[e][f] = 1 + min over k in [1, f] of
max(dp[e-1][k-1], dp[e][f-k])
For 2 eggs over 36 floors, the optimal worst-case is 8 trials
(closed form: triangular number bound).
Tests 2D DP with triple-nested for-loops, max-of-two via inline
if, large sentinel constant (100000000), mixed shifted indexing
(e-1) and (f-k) where both shift independently.
163 baseline programs total.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
"count_change.ml": 406,
|
||||
"count_inversions.ml": 12,
|
||||
"csv.ml": 10,
|
||||
"egg_drop.ml": 8,
|
||||
"dijkstra.ml": 7,
|
||||
"exception_handle.ml": 4,
|
||||
"exception_user.ml": 26,
|
||||
|
||||
Reference in New Issue
Block a user