Updated SpanningTree.java