You are on page 1of 1
CS2302 Fall 2010 Lab 5 Due electronically by 11:59 p.m., Monday, November 22, 2010 Implement the algorithm for building mazes using the union/find data structure that is described in Section 8.7 of the textbook, Implement 3 types of union/find algorithms, using: a. Simple union (first root points to second root) b. Union by height c. Path compression Run experiments to determine the running times of your maze-building program for different ‘maze sizes and the 3 varieties of the union/find algorithm, ‘Write a program that implements Kruskal’s minimum spanning tree (MST) algorithm for undirected weighted graphs. Your program should take as input a file that contains the edges in the graph, one per line, and output the subset of the set of edges that belong to the MST. You ‘must use your implementation of union find from part 1 to determine if edges create cycles. As usual, write a report describing your work, including the problem, your solution, and experimental results, as stated in the syllabus.

You might also like