ocaml: phase 5.1 island_count.ml baseline (6x7 grid, 5 components)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s
Count 4-connected components of 1-cells via DFS flood from every
unvisited 1-cell.
Grid (1s shown as #):
# # . . . # #
# . . . # # .
. . # # . . .
. # # # . # #
# . . . . # .
# # . # # # .
Components:
{(0,0),(0,1),(1,0)}
{(0,5),(0,6),(1,4),(1,5)}
{(2,2),(2,3),(3,1),(3,2),(3,3)}
{(3,5),(3,6),(4,5),(5,3),(5,4),(5,5)}
{(4,0),(5,0),(5,1)}
-> 5 islands
Complementary to flood_fill.ml (largest component); this counts
total components.
Tests recursive function returning () at early-exit branches,
ordered double-for entry pass triggering one fill per island root.
180 baseline programs total.
This commit is contained in:
@@ -80,6 +80,7 @@
|
||||
"huffman.ml": 224,
|
||||
"int_sqrt.ml": 1027,
|
||||
"is_prime.ml": 25,
|
||||
"island_count.ml": 5,
|
||||
"fizz_classifier.ml": 540,
|
||||
"fizzbuzz.ml": 57,
|
||||
"flatten_tree.ml": 28,
|
||||
|
||||
Reference in New Issue
Block a user