x

31

y

5f

others

5bdb76d078c43b8ac0064e4a0164612b1fce77c86934

unused

5bfc94c75894edd3

**22 May 2022**

Read 12 byte pairs from the array, representing
a series of (x, y) points. Draw each point on the canvas,
connecting it to every other point.

Then, determine the
Minimum spanning tree
of the points: the continguous series of lines which connect to every point
while minimizing the total length of the lines.

You can use
Kruskal's algorithm
to determine this.

algorithm Kruskal(G) is F:= ∅ for each v ∈ G.V do MAKE-SET(v) for each (u, v) in G.E ordered by weight(u, v), increasing do if FIND-SET(u) ≠ FIND-SET(v) then F:= F ∪ {(u, v)} ∪ {(v, u)} UNION(FIND-SET(u), FIND-SET(v)) return F

Draw the lines in the Minimum spanning tree in bold.