Implemented Kruskals Algo for MST.