AT&T Interview Question

to implement the kroskal algoithm.